Hi,
I'm having problems checking whether a string is an unsigned integer. The code I am using only checks the first character of the string, so "a1" would return false, but "1a" would return true. Any ideas where I'm going wrong?
bool checkUnsignedInt(string *str)
{
unsigned long value;
stringstream ss(*str);
if (ss >> value)
{
return true;
}
else
{
return false;
}
}
Thanks