Just to clarify what he said, in C any non-zero value is true. Zero is false. So, if you had a variable and you wanted to test if it was zero, you could say:
Code:
if(!variableBeingTested)
{
// Variable is zero
}
else
{
// Variable is not zero
}
It is considered better form by most people, however to explicitly put in the test for zero. For example:
Code:
if(variableBeingTested == 0)
{
// Variable is zero
}
else
{
// Variable is not zero
}
--EDIT--
PS I just looked at the last post guy's name and team number and realized he's one of my team's mentors.
