随笔分类 -  C++

摘要:char name[10]; _itoa_s(i,name,10); const char* path=".jpg"; strcat(name,path); 阅读全文
posted @ 2018-05-24 14:30 Henry2017 阅读(865) 评论(0) 推荐(0)
摘要://http://blog.csdn.net/lijia11080117/article/details/42042301?locationNum=10#include "stdafx.h" #include #include #include #include int _tmain(int argc, _TCHAR* argv[]) { FILE *fp; long siz; char p... 阅读全文
posted @ 2017-11-24 14:10 Henry2017 阅读(2299) 评论(0) 推荐(0)
摘要:access函数判断文件夹或者文件是否存在函数原型: int access(const char *filename, int mode);所属头文件:io.hfilename:可以填写文件夹路径或者文件路径mode:0 (F_OK) 只判断是否存在 2 (R_OK) 判断写入权限 4 (W_OK) 判断读取权限 6 (X_OK) 判断执... 阅读全文
posted @ 2017-10-13 11:14 Henry2017 阅读(304) 评论(0) 推荐(0)
摘要:1 float start =clock(); 2 //TODO:再次插入需要测试的程序段 3 4 float end=clock(); 5 float time = (end-start)/CLOCKS_PER_SEC; 6 cout<<time; 阅读全文
posted @ 2017-08-08 15:30 Henry2017 阅读(288) 评论(0) 推荐(0)
摘要:转载:http://blog.csdn.net/u013467442/article/details/43666955 阅读全文
posted @ 2017-08-07 15:51 Henry2017 阅读(741) 评论(0) 推荐(0)
摘要:转自 :http://blog.csdn.net/slience_perseverance/article/details/6695048 qsort对二维数组排序与对以为数组排序是一样的几乎没有什么差别,而且后来想想定义一个二维数组所占的空间与定义一个机构体所占的空间是一样 的,所以没有必要用多维 阅读全文
posted @ 2017-07-13 22:16 Henry2017 阅读(5000) 评论(0) 推荐(0)
摘要:Point2f pointIntersection(Point2f p1, Point2f p2, Point2f p3, Point2f p4) { //p1,p2所在一条直线,p3,p4所在一条直线,求两条直线的交点 //p1,p2所成的直线 BOOL flag1=FALSE,flag2=FALSE; Point2f p;//存放最后的交点 float... 阅读全文
posted @ 2017-07-04 23:23 Henry2017 阅读(1015) 评论(0) 推荐(1)
摘要:1 #include "stdafx.h" 2 #include 3 4 using namespace std; 5 6 /* 构造完成标志 */ 7 bool sign = false; 8 9 /* 创建数独矩阵 */ 10 int num[9][9]; 11 12 /* 函数声明 */ 13 void Inp... 阅读全文
posted @ 2017-06-29 16:03 Henry2017 阅读(724) 评论(0) 推荐(0)
摘要:具体见: http://blog.csdn.net/theplayerwuliang/article/details/6431722 复制代码可运行: 阅读全文
posted @ 2017-06-05 21:21 Henry2017 阅读(428) 评论(0) 推荐(0)
摘要:CString str("1234");int i= _ttoi(str);在ANSI 和 UNICODE 都可以用的代码 int s = 123; CString str; str.Format(_T("%d"),s); 阅读全文
posted @ 2017-05-23 14:19 Henry2017 阅读(183) 评论(0) 推荐(0)
摘要:http://www.cnblogs.com/finallyliuyu/archive/2010/10/11/1848130.html 阅读全文
posted @ 2017-05-18 15:48 Henry2017 阅读(145) 评论(0) 推荐(0)
摘要:转自 华山大师兄 http://www.cnblogs.com/biyeymyhjob/archive/2012/07/19/2598815.html 题外一句,利用extern使用别的CPP文件的全局变量^_^ 1.先来介绍它的第一条也是最重要的一条:隐藏。(static函数,static变量均可 阅读全文
posted @ 2017-05-03 11:46 Henry2017 阅读(286) 评论(0) 推荐(0)
摘要:for (vector<Point> ::iterator iter1 = section0.begin(); iter1 != section0.end(); ++iter1) 阅读全文
posted @ 2017-05-01 15:01 Henry2017 阅读(132) 评论(0) 推荐(0)
摘要:1 #include "set" 2 #include "vector" 3 #include <algorithm> 4 using namespace std; 5 6 int main(void) 7 { 8 int iarr1[]={1,2,3,3,4,5,6,7,9}; 9 int iar 阅读全文
posted @ 2016-08-22 17:21 Henry2017 阅读(1016) 评论(0) 推荐(0)
摘要:via http://blog.csdn.net/ls306196689/article/details/35787955 方式三用时最短 方式一 for (size_t i =0; i < vec.size(); i ++) { int d = vec[i]; } 方式二 size_t len = 阅读全文
posted @ 2016-08-22 17:19 Henry2017 阅读(748) 评论(0) 推荐(0)
摘要:typedef Vec<int, 4> Vec4i; 数据类型后面的_t是什么意思: 是一个结构的标注,可以理解为 type/typedef 的缩写,表示它是通过 typedef 定义的, 而不是其它数据类型。 例如uint8_t,uint16_t,uint32_t 等都不是什么新的数据类型,它们只 阅读全文
posted @ 2016-08-12 15:25 Henry2017 阅读(434) 评论(0) 推荐(0)
摘要:一般0和-1或者0和1使用0和-1使用时:0一般表示成功执行-1一般表示不成功0和1使用时:1真0假 阅读全文
posted @ 2016-08-12 11:03 Henry2017 阅读(166) 评论(0) 推荐(0)