首页 > 技术文章 > error C4996: 'strcpy': This function or variable may be unsafe.

marsdu 2013-08-27 20:42 原文

vs2012用strcpy遇到的错误。

错误描述:error C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

如果还想继续使用strcpy可以这样做:

image

image

image

然后在运行就不会有错了。

推荐阅读