Btw, if the warning levels are high enough, some compilers will warn about assignment like that inside if statements. A typical example is Visual Studio.