how to test if user has entered valid integer

isdigit takes char as parameter so how would i test that user has entered integer not any garbage ..
In STL map if map is map<string ,string> where ist arg is student name and 2nd arg is marks taken in string for error checking.how would i compare the marks in map is less than the value entered by the user.ie i have to compare a string with an integer .
please suggest atoi is not working i have tried with that
how would i test that user has entered integer not any garbage ..

see http://www.cplusplus.com/forum/articles/6046/

if the string simply contains the digits of the number (like this: "12") see http://www.cplusplus.com/articles/numb_to_text/#s2n
if the string has a different format let me know

Topic archived. No new replies allowed.