int main() {
string testnumber = "10";
int myInt = stoi(testnumber);
cout << myInt;
return 0;
}
Here is my error message: error: 'stoi' was not declared in this scope
I have to work with Code::Blocks 13.12 MinGW/GCC (4.8.1).
I am not allowed to change the program and the compiler either.
Has anyone a solution for this, please ?
If that exact verbatim example doesn't work (along with the appropriate "-std=c++11" flag), then perhaps MinGW (or rather, that version of MinGW) doesn't handle stoi. Try using a more up to date environment and compiler.
Did some research, that version does support stoi. You're doing something wrong.