且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

此功能或变量可能不安全

更新时间:2021-08-26 02:30:21

警告信息非常明确:

'fopen':这个函数或变量可能不安全。考虑使用fopen_s代替。



见这里: http://msdn.microsoft.com/en-us/library/ttcz0bys.aspx [ ^ ]



这意味着新代码不建议使用 fopen ,因为它可能会从未来版本中删除,并被更新,更好的版本所取代 - 在此case fopen_s



要么使用它建议的更现代的等价物,要么禁用警告(我会去第一个选项,我自己)
The warning message is quite explicit:
"'fopen': This function or variable may be unsafe. Consider using fopen_s instead."

See here: http://msdn.microsoft.com/en-us/library/ttcz0bys.aspx[^]

What it means is that fopen is not recommended for new code, as it may be removed from future version, having been superceeded by a newer, better version - in this case fopen_s

Either use the more modern equivalent as it suggests, or disable the warning (I'd go with the first option, myself)