Inspired by another question regarding java-script language. Can the expression
(a==1)&&(a==2)&&(a==3)
evaluate to true i
Other things not mentioned yet (source):
a
might have overloaded operator int()
, the operator for implicit conversion to int
(instead of operator==
as covered by other answers).a
might be a preprocessor macro.Example of the latter:
int b = 0;
#define a ++b
if ((a==1)&&(a==2)&&(a==3))
std::cout << "aha\n";