I see... well, sorry but I don't know how to get around using "gets" on Visual Studio 2017's compiler. Maybe someone else knows.
My suggestion would be to email your instructor, if possible, and ask them if it's possible to use gets_s as opposed to gets. It's still the "very hard way" and doesn't use modern C++ std::strings.
Is it possible for you to download Visual Studio 2015, or maybe use another compiler, like GCC?
You can download gcc (MinGW) from a place like here https://nuwen.net/mingw.html
and compile your file via
g++ -std=c++98 mycode.cpp -o mycode.exe
Or, you can use online compilers like ideone.com
to see if they'll let you use gets.
For example, if you go to cpp.sh
, go to options and select Standard C++98
, otherwise gets won't compile.