warning C4996: ''strcpy'' was declared deprecated
2009-02-23 17:43
344 查看
是因为VC2005中认为CRT中的一组函数如果使用不当,可能会产生诸如内存泄露、缓冲区溢出、非法访问等安全问题。这些函数如:strcpy、strcat等。 对于这些问题,VC2005建议使用这些函数的更高级的安全版本,即在这些函数名后面加了一个_s的函数。这些安全版本函数使用起来更有效,也便于识别,如:strcpy_s,calloc_s等。
1. 如果执意使用老版本、非安全版本函数,可以使用_CRT_SECURE_NO_DEPRECATE标记来忽略这些警告问题。
2. 办法是在编译选项 C/C++ | Preprocessor | Preprocessor Definitions中,增加_CRT_SECURE_NO_DEPRECATE标记即可。
文章出处:http://www.diybl.com/course/3_program/vc/vc_js/2008428/111840.html
1. 如果执意使用老版本、非安全版本函数,可以使用_CRT_SECURE_NO_DEPRECATE标记来忽略这些警告问题。
2. 办法是在编译选项 C/C++ | Preprocessor | Preprocessor Definitions中,增加_CRT_SECURE_NO_DEPRECATE标记即可。
文章出处:http://www.diybl.com/course/3_program/vc/vc_js/2008428/111840.html
相关文章推荐
- VC2005去掉烦人的warning C4996: '×××' was declared deprecated
- warning C4996: '_snprintf' was declared deprecated 警告信息的消除方法
- VS2005 出现warning C4996: strcpy was declared deprecated
- visual studio 2005:warning C4996: strcpy was declared deprecated
- clCreateCommandQueue': was declared deprecated
- warning C4996: 'strcpy' was declared deprecated
- VS2005编译VC6的工程,warning C4996: strcpy was declared deprecated
- warning C4996: strcpy was declared deprecated
- clCreateCommandQueue': was declared deprecated
- VS2005 出现警告warning C4996: strcpy was declared deprecated 的解决办法
- VS2005 出现warning C4996: strcpy was declared deprecated
- 'scanf' was declared deprecated,
- 'function': was declared deprecated
- (转)出现这样的警告 warning C4996: strcpy was declared deprecated
- [Error] 'atoi' was not declared in this scope
- warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead.
- error: 'EOF' was not declared in this scope的解决办法
- warning C4996: 'sprintf' was declared deprecated see declaration of 'sprintf'
- warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead.
- error: 'ff_get_buffer' was not declared in this scope