Question about || operator

I was just wondering if someone could explain this output to me.

I have this:

cout<<strcmp(buf, "time")<<" "<<strcmp(buf, "time")<<" "<<(strcmp(buf, "time") || strcmp(buf, "TIME"))<<endl;

buf is a char array with the characters "date"

the output is "-16 -16 1"

It's throwing off my program because it seems to me its taking 2 false things and ORing them together and making them true.
"false" is zero. Anything that isn't zero is true.

strcmp(buf,"time") is -16, which is nonzero, which is true.
Topic archived. No new replies allowed.