convert a string to an integer

why do I get an upside-down question mark with the following function?

int FileInfo ()
string FileLine;
string index;
FileLine = "6 600 87 88 89 90 91 92 60";
index = atoi((FileLine.substr(0, 1)).c_str());
cout << index << endl;

return 0;
}//end FileInfo

I want to turn the "numbers" in string to integers.
You have index declared as a string and then you are trying to put an int inside of it using atoi.

Declare index as an int instead.
awesome! Thanks!
Topic archived. No new replies allowed.