严重性代码说明项目文件 行错误 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. Test f:\cworkspace\test\test\main.c 30

用VS编译代码是遇到如上问题,vs准备弃用strcpy的,安全性较低,所以微软提供了strcpy_s来代替,如果想继续使用strcpy的,main前面加上

#pragma warning(disable:4996)

另:
C语言使用strcpy 包含头文件 #include <string.h>
C++使用strcpy 包含头文件 #include <cstring> 使用命名空间 using namespace std;

相关文章:

  • 2021-10-07
  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
  • 2021-09-16
  • 2021-10-11
  • 2022-12-23
  • 2021-12-11
猜你喜欢
  • 2021-06-21
  • 2022-01-01
  • 2022-01-03
  • 2021-07-04
  • 2021-10-31
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案