VS错误提示:To disable deprecation, use _CRT_SECURE_NO_WARNINGS.

Severity Code Description Project File Line Suppression State
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.

解决方案:更改预处理定义

  1. 右击项目名,选择Properties
    VS错误提示:To disable deprecation, use _CRT_SECURE_NO_WARNINGS._第1张图片
  2. 在c/c++下选择Preprocessor
    VS错误提示:To disable deprecation, use _CRT_SECURE_NO_WARNINGS._第2张图片
  3. 点击图示Preprocessor Definitions,选择,添加预处理器定义

_CRT_SECURE_NO_WARNINGS

VS错误提示:To disable deprecation, use _CRT_SECURE_NO_WARNINGS._第3张图片
VS错误提示:To disable deprecation, use _CRT_SECURE_NO_WARNINGS._第4张图片

你可能感兴趣的:(C++)