Original Post
I have this code: Assumptions - 1) data is a vector filled with strings from a file. 2) the first string is an int. x turns out to be some number like -834039483, when it should be 5. why isn't this working. Do I need to use an iterator?
//convert string to int
int x;
stringstream StrToInt(data[0]);
StrToInt >> x;
cout << x << "\n";