文章出处https://blog.csdn.net/qq_38721302/article/details/82850292

今天编写C++程序在使用头文件#include<cstring>中的strcpy()和strcat()函数时出现了一个错误:error C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead.在网上搜了一下大概知道怎么解决了,并且知道为什么出现这个错误——出现这个错误时,是因为strcpy()和strcat()函数不安全造成的溢出。
解决方法是:找到【项目属性】,点击【C++】里的【预处理器】,对【预处理器】进行编辑,在里面加入一段代码:_CRT_SECURE_NO_WARNINGS。

‘strcpy‘: This function or variable may be unsafe. Consider using strcpy_s instead.

 ‘strcpy‘: This function or variable may be unsafe. Consider using strcpy_s instead.

 

相关文章:

  • 2021-08-24
  • 2021-10-16
  • 2022-12-23
  • 2022-12-23
  • 2021-09-20
  • 2021-07-20
  • 2022-12-23
  • 2021-04-09
猜你喜欢
  • 2021-10-29
  • 2021-08-30
  • 2021-11-13
  • 2022-12-23
  • 2022-01-07
相关资源
相似解决方案