VS2017出现C4996 'fopen': This function or variable may be unsafe. Consider using fopen_s instead.错误

VS2017利用fopen和fscanf读取文件时出现以下错误信息:
C4996 ‘fopen’: This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C4996 ‘fscanf’: This function or variable may be unsafe. Consider using fscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

解决办法:
项目——属性——C/C++——预处理器——预处理器定义——右侧下拉框中“编辑”——在第一个编辑框中添加_CRT_SECURE_NO_WARNINGS——大功告成
————————————————
版权声明:本文为CSDN博主「HerofH_」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_28114615/article/details/85683550

posted @ 2021-08-29 22:33  一笔浓墨  阅读(160)  评论(0编辑  收藏  举报