Following advice from one of my other problems, I decided to make use of stoi(). Here is my implementation:
1 2 3 4 5 6 7 8 9 10
//A sort of loading function
char array[100];
string medium;
int health;
ifstream saveFile ("Save.txt");
saveFile.getLine(array, 100);
medium = array;
health = stoi(medium, NULL, 10);
Compiler(GNU GCC with Code::Blocks, latest version) tells me that stoi() was not declared in this scope. When I replace stoi with std::stoi, despite the fact that I included usingnamespace std; at the beginning of the program. All necessary libraries, iostream and string, are included. I have no idea what is going on, please help!
Otherwise, if you're using a 32-bit version of MinGW, then you don't have stoi (or any of those other std::string <--> integer conversion functions, for that matter).