摘要: string、char[]、char*、const char*; 输出都一样 printf只能输出c语言中的内置数据,string不是c语言内置数据; cout可以输出string字符串,是因为string中重载了“<<”操作符; printf_s("%s\n", arrc); \\char[]pr 阅读全文
posted @ 2018-11-22 19:09 kuaqi 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 在处理LPTSTR或LPCTSTR的时候,应该使用_tcslen来替代strlen函数。否则,在Unicode编码方式下,strlen不能处理wchar_t*的字符串。 阅读全文
posted @ 2018-11-22 18:55 kuaqi 阅读(392) 评论(0) 推荐(0) 编辑
摘要: 格式: CString cstr.AppendFormat(_T(" %.4f "), ); 输出: (1) https://blog.csdn.net/overlord_bingo/article/details/60140224 不含中文的情况下: CString s("hello world" 阅读全文
posted @ 2018-11-22 18:25 kuaqi 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 模板声明只能在全局、命名空间、或类范围内使用; 阅读全文
posted @ 2018-11-19 18:43 kuaqi 阅读(102) 评论(0) 推荐(0) 编辑
摘要: cin 遇到空格完成单个数据传入,不退出; 遇到回车'\n'退出; 阅读全文
posted @ 2018-11-19 11:17 kuaqi 阅读(435) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/wanghetao/p/4492582.html https://www.cnblogs.com/Dageking/p/3185230.html http://www.cnblogs.com/catch/p/4314256.html:初始化 https 阅读全文
posted @ 2018-11-18 19:03 kuaqi 阅读(2524) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/songdanzju/p/7422380.html https://blog.csdn.net/chudongfang2015/article/details/76326115 https://www.cnblogs.com/Dageking/p/31 阅读全文
posted @ 2018-11-17 23:39 kuaqi 阅读(372) 评论(0) 推荐(0) 编辑
摘要: 导入lib与双重设置头文件(生成dll和exe调用dll时) #ifndef AAA#ifdef BB_API :BB_API可以放在生成dll的cpp中#define AAA __declspec(dllexport)#else#define AAA __declspec(dllimport)#p 阅读全文
posted @ 2018-11-17 20:13 kuaqi 阅读(224) 评论(0) 推荐(0) 编辑
摘要: uint32_t是C/C++ 标准中定义的类型。 而uint32是 某些 编译器定义的别名,以方便使用。类似: uint32_t 比 uint32的可移植性更好 。 阅读全文
posted @ 2018-11-16 17:00 kuaqi 阅读(14371) 评论(0) 推荐(0) 编辑
摘要: 1.c_str 返回值是const char*,不能直接赋值给char*; 如果改变了string对象s的内容;s.c_str指向的内容也会改变; char* c; string s="1234"; c = s.c_str(); //c最后指向的内容是垃圾,因为s对象被析构,其内容被处理 应该这样用 阅读全文
posted @ 2018-11-15 19:15 kuaqi 阅读(202) 评论(0) 推荐(0) 编辑