C语言VS中strcat报错
C4996 ‘strcat’: This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
原因
vs编译器认为C语言提供的strcat函数是不安全的
解决方法
- 1 在程序的第一行加上#pragma warning(disable:4996)
- 2 vs提供了一个更安全的函数strcat_s,使用strcat_s代替strcat。但strcat_s的兼容性不好,其他编译器可能无法识别