'fopen' was declared deprecated

来源:百度知道 编辑:UC知道 时间:2024/06/15 16:14:44
warning C4996: 'fopen' was declared deprecated
warning C4018: '<' : signed/unsigned mismatch
warning C4018: '<' : signed/unsigned mismatch
是怎么回事啊?怎么才能不出现警告啊?

说不赞成你使用fopen
你可以使用fopen_s试试

FILE* pfile;
if(fopen_s(&pfile,"abc.txt","r")!=0)

或者
工程项目属性选项的C++/预处理器/预处理器定义中加上_CRT_SECURE_NO_DEPRECATE这个宏。