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——大功告成

你可能感兴趣的:(其他)