error C4996: 'scanf': This function or variable may be unsafe.Visual Studio系列編譯器使用scanf函數報錯

VS2017寫C代碼出現:
error C4996: ‘scanf’: This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
的錯誤,在.cpp文件的頂部添加 #define _CRT_SECURE_NO_WARNINGS 10 即可解決問題。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章