Printable View
Quote: Originally Posted by KingTermite if ( (GetAsyncKeyState(VK_F8) && x ) > 1) Would this ever be true? I think (a && b) returns either 0 or 1, never >1.
Quote: Originally Posted by KingTermite is this supposed to be: if ( (GetAsyncKeyState(VK_F8) && x ) > 1) or if (GetAsyncKeyState(VK_F8) && (x > 1) ) Compiler probably doesn't know? You have two evaluations there. That wouldn't be ambiguous to the compiler.
Quote: Originally Posted by GCDEF That wouldn't be ambiguous to the compiler. Neither one is ambiguous to compiler. For the programmer – may be. Compare operators have higher precedence than logical AND.
Quote: Originally Posted by w3rd Would this ever be true? I think (a && b) returns either 0 or 1, never >1. I thought a && b returns true or false. i'm not sure that true is equivalent to 1
Quote: Originally Posted by Amleto I thought a && b returns true or false. That is true in C++. Quote: Originally Posted by Amleto i'm not sure that true is equivalent to 1 true is converted to 1.