
C/C++
虫师魁拔
这个作者很懒,什么都没留下…
展开
-
VS (Qt/MFC)常见编译问题
1、error C4996: ‘sprintf’: This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 原因 这种微软的警告,主要因为那些C库的函数,很多函数内部是不进行参数检测的(包括越界类的),微软担心使用这些会造成内存异常,所以就改写了同样功能原创 2020-07-07 11:28:21 · 780 阅读 · 0 评论 -
C/C++ struct定义
一、typedef开头的 以typedef开头的必现要在最后加上个“别名”。有两种写法: 1 完整的写法 typedef struct MyStruct { int i; }Ms; struct MyStruct s; //或者 Ms s; s.i = 0; 2 省略前面“类名”的写法 typedef struct { int i; }Ms; //只能使用下面这样的了 Ms ...原创 2019-01-23 18:29:24 · 8162 阅读 · 0 评论