Check and convert a string to an integer
BOOL is_str_numeric_integer( LPCSTR lpcszStr, int * lpnVal = NULL )
true if str can be converted to an integer ,otherwise false
EX1
void is_str_numeric_integer_ex1() { int i = 0; string str = "-123";//change to "abc" or "123.456" to see different result; bool bRet = is_str_numeric_integer(str , &i); if(bRet) printf("\"%s\" is converted to %d \n" ,str ,i); else printf("\"%s\" can not be converted to an integer\n" ,str); }
is_str_numeric_integer_with_args
origin.h