Visual Studio解决freopen等函数报错函数安全问题

VS中使用freopen、fopen、sprintf等函数是会出现安全问题:
error C4996: 'xxxxx': This function or variable may be unsafe. Consider using xxxxxx instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
而报错。
 
解决方法
工程上右键,选择 属性->C/C++->预处理器,预处理器定义中加入一条:_CRT_SECURE_NO_WARNINGS,确认,问题解决。

猜你喜欢

转载自www.cnblogs.com/RootChu/p/9280760.html
今日推荐