I sometimes see this in a C program (I'm using the C18 compiler):
unsigned char someValue = getSomeDataFromSomewhere();
if (someValue) {
doStuff();
} else {
doOtherStuff();
}
I know what happens when you give an if
loop a boolean (unsigned
in the C18 compiler), but what happens when you put a non-boolean in?
My guess: it does doStuff()
when the value isn't zero, and doOtherStuff()
when the value is zero. But I don't know this, so I'd like to get some reference.