vs2019中使用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.
解决方法
(1)打开项目里的属性
(2)配置属性——C/C++——预处理器——预处理器定义中加入一条指令:_CRT_SECURE_NO_WARNINGS,确认即可。