maruf maruf - 1 year ago 145
C++ Question

gets() function is not available in Visual studio 2015 community

I have faced a compiler error(c3861) in my newly installed Visual studio community 2015 IDE:

I just want to use gets() function from stdio.h library, and i have included

file in my program, but compiler show me a compiler error
like below:

error C3861: 'gets': identifier not found

What should i do to compile my program correctly with

Answer Source

if you are looking forward to learn about

buffer overflow vulnerability

you simply can use it and anther unsafe functions by the fallowing steps

  1. from the solution explorer right click on the project and choose properties
  2. navigate to Configuration Properties >> C/C++ >> Advanced
  3. change Compile As value to Compile as C Code (/TC)
  4. (optional) if you would like to disable the warning just put its warning number in disable specific warning
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download