天天看点

error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead.

error C4996: ‘scanf’: This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.

如果scanf 在好几个文件中,解决起来就太麻烦了。

更改设置,一劳永逸!

解决办法:

将
_CRT_SECURE_NO_WARNINGS
插入到:
Project --> Property Pages --> Configuration Properties
 --> C/C++ --> Preprocessor --> Preprocessor Definition --> <Edit>
中。