converting string to int
Posted on 2004-10-16
i'm using visual studio. i consider myself a novice when it comes to c++
i have a string that i'd like to convert to an int:
//not real code...
//read user input from std in
cin.getline (number, sizeof(number));
//do something to number so it becomes an int
i can just do cin >> number (or << whatever, it's late), but i'd like to have some kind of user validation.
btw, take the code sample as pseudocode :)