help please (newbie with C)
I need help with understanding relational operators like...assigning a variable to a relational operator. In my C book ("Complete Beginners Guide to C") it said if the value is false then it is 0 and if true then the relational operator is 1. But what is the point of this? Why wouldn't i just assign a 1 or 0 to the variable?
In an exmple explaining a the for operator is shows this
for (sub=0; sub<=51; sub++)
val= (val==14) ? 1 : val; /*If val is 14, reset to 1 */
So it resets to one after getting to 14? I'm trying to figure this out but the only source of information i'm getting is from a comment. I've tried looking in tutorials but they don't explain it..is there a tutorial that explains this? i looked really hard but couldn't find one.
So what is the point of assigning relational operators to variables if it's just going to give me a 1 or a 0? why don't i assign it a 1 or a zero?
Could someone give me a quick source code that would give me a use for this function?
thankyou
oh and sorry if i was suppose to make a topic declaring me being here i didn't see it in the rules.