嚴重性代碼說明項目文件 行錯誤 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;