关于VS系列使用 Unicode 格式产生以上警告:
warning C4996: 'wcscpy': This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
MSDN
Generic-Text Routine Mappings
TCHAR.H Routine _UNICODE Defined
_tcscpy wcscpy
解决方案
项目 ->属性 -> c/c++ -> 预处理器 -> 预处理器定义,加入 _CRT_SECURE_NO_WARNINGS,即可。
Deprecated function |
Security-enhanced replacement |
---|---|
asctime |
asctime_s |
_controlfp |
|
_creat |
_sopen_s |
_cscanf |
_cscanf_s |
_cscanf_l |
_cscanf_s_l |
ctime |
ctime_s |
_ctime32 |
_ctime32_s |
_ctime64 |
_ctime64_s |
_cwscanf |
_cwscanf_s |
_cwscanf_l |
_cwscanf_s_l |
fopen |
fopen_s |
freopen |