I have a string, taken via a substring. I need to convert it into an integer. The string is of class string. I.e.:

Code:
string line;
// line inputs from a file...
int index= line.find(' ',0);
string temp= line.subt(0, index);
I know that temp is a number...because the file I'm inputting from has the following line (I checked the value of line, it's correctly inputted):

1 -1 -1 1.

How can I convert it?

--Ashiq