I am currently using Visual Studio Community 2017. From looking at the C++ Language Standards in the project properties, they only provide C++14 and C++17. Since my code was
The Visual C++ 2017 compiler is C++11/C++14 compliant with a few specific exceptions:
The compiler does not offer a specific C++11 mode and defaults to C++14, but that standard is fully inclusive of C++11. C++17 support is in progress, and requires you use the /std:c++17 or /std::c++latest switch.
std::stoi requires you include the appropriate header, specifically Either you forgot to include that header -or- you didn't deal with the namespace resolution (either explicitly as std:: or via using namespace std;)
See C++17 Features And STL Fixes In VS 2017 15.3 for the latest status of C++11/C++14/C++17 standards conformance as of the VS 2017 (15.3 update)
UPDATED: Now that you have posted your code, I see that the problem has nothing to do with which standard is supported. Your problem is that you don't know the secrets of how Precompiled Headers work.
Change:
#include
#include "stdafx.h"
to:
#include "stdafx.h"
#include
-or- add #include to the precompiled header stdafx.h directly.
See Creating Precompiled Header Files