I am trying to convert a string to int using stoi. My IDE is codeblocks and I made sure I am using the c++11 compiler but I am still getting this error:
error: 'stoi' was not declared in this scope
Does anyone know of a fix for this?
Did you set the option for C++11 support? It should be available in Project->Build Options and then check "Have g++ follow the C++11 ISO C++ language standard" (or go to Settings->Compiler to set it as default for all projects). If you did, could you post the build log of your program? That way we can see all options passed to the compiler and the exact error it gives. It's easier to diagnose it that way.