C语言在VS2012上读取TXT文件时遇到错误:


error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.


解决方案:在项目名称上右键、属性(Properties)、C/C++,预处理器定义(Preprocessor Definitions),编辑(Edit),在里面粘贴_CRT_SECURE_NO_WARNINGS。