Gets() 函数在 Visual Studio 2015 社区中不可用 [英] gets() function is not available in Visual studio 2015 community
本文介绍了Gets() 函数在 Visual Studio 2015 社区中不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在新安装的 Visual Studio community 2015 IDE 中遇到了编译器错误 (c3861):
I have faced a compiler error(c3861) in my newly installed Visual studio community 2015 IDE:
我只想使用 stdio.h 库中的 gets() 函数,并且我在我的程序中包含了 stdio.h
文件,但是编译器向我展示了一个编译器错误如下图:
I just want to use gets() function from stdio.h library, and i have included stdio.h
file in my program, but compiler show me a compiler error
like below:
error C3861: 'gets': identifier not found
我应该怎么做才能使用gets()
函数正确编译我的程序.
What should i do to compile my program correctly withgets()
function.
推荐答案
如果你期待学习
关于
缓冲区溢出漏洞
您只需通过以下步骤即可使用它和其他不安全的功能
you simply can use it and anther unsafe functions by the fallowing steps
- 在解决方案资源管理器中右键单击项目并选择属性
- 导航到配置属性 >> C/C++ >> 高级
- 将
Compile As
值更改为Compile as C Code (/TC)
- (可选)如果您想禁用警告,只需将其警告编号放在
disable specific warning
- from the solution explorer right click on the project and choose properties
- navigate to Configuration Properties >> C/C++ >> Advanced
- change
Compile As
value toCompile as C Code (/TC)
- (optional) if you would like to disable the warning just put its warning number in
disable specific warning
这篇关于Gets() 函数在 Visual Studio 2015 社区中不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文