Check to see if char or string

When i am building programs that require input of integers, i quite often find that if you enter a letter or words while the integer is in a loop, it will screw up, so i was wondering if there was a way for the program to check and see if what the person entered was a string or char instead of numbers.
Always use string for the user input.
Then you can use e.g. stringstream http://www.cplusplus.com/reference/iostream/stringstream/ for both:
checking if it's a valid number and convert it to that number
Input it as a string and convert the string using atoi()
http://www.cplusplus.com/reference/clibrary/cstdlib/atoi/
Topic archived. No new replies allowed.