   atoi question
  In c++, I want to use atoi to convert a char* pseudo-string to an integer.  However, I can't seem to find a way to easily check if the input string is in fact a valid integer before calling atoi.  Is there a method that does this?   
  One option is to use  boost::lexical_cast instead of atoi(). It will perform the conversion and throw an exception if the string doesn't represent an integer.You can achieve functionality manually by creating a stringstream, and use str() to set the buffer to be equal to your input string. Then use the integer extraction operator. If the fail bit is set on the stream, then it wasn't a valid number string. If there is input remaining in the stream then the string didn't represent a valid integer (as could be the case for something like "765D".   ;  You could just loop throught the chars in the string and check to see if each one is a valid ascii number.  Pretty simple function.theTroll   ;  I use strtol instead of atoi, then you get a pointer to the last char in the number and can check if it is '\0'.   