So I wrote a function that checks whether or not a string has a numeric character. Even if there is just 1 letter in a group of numbers, it should return false. However it doesn't. I'm not sure if loops work differently in C++ or not.
bool isStringAValidNumber(string str)
{
for (int i = 0; i < str.length(); i++) {
if (!isdigit(str[i])) {
return false;
break;
}
}
return true;
}