Tag Archives: C based

error C4996: ‘scanf‘: This function or variable may be unsafe.Visual Studio Series compilers report errors using scanf function

When vs2017 writes C code, it appears:
error c4996: ‘scanf’: this function or variable may be unsafe. Consider using scanf_ s instead. To disable deprecation, use _ CRT_ SECURE_ NO_ Error in warnings. See online help for details.

Solution: add # define at the top of the. Cpp file_ CRT_ SECURE_ NO_ WARNINGS 10 。