I'm rather new at C/C++ and I'm having trouble understanding how these things work. I'm reading a tutorial on them but I don't understand the return values that I'm getting. Let's use the isdigit() function as an example, the tutorial says:
The isdigit() function returns non-zero for true and zero for false. If the parameter is not in the domain of the function, the return result is undefined.
Now suppose that I use the following code:
Code:
int var_one = 1;
bool var_two = isdigit(var_one);
cout << var_two << endl;
The program will output a 0 for false, but var_one is a digit. What am I missing here?