maruf maruf - 1 month ago 21
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

stdio.h
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
gets()
function.

Answer

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