Expressions are essentially the same as C, including boolean expressions. As in C, an assignment of the form x = expr returns a value, namely the final value of the expression expr that is assigned to the variable x. Hence, like C, for checking equality, use == not =, but (as noted above), stupidities like if (x = 7).... will be caught by the compiler.