Reversing equality test to avoid errors Sajo Posted on April 25, 2006 Posted in Programming 1 Comment Common mistake if(x=2) instead of if(x==2) Write the rvalue of the expression at the left side of the equality operator (==): if(2==x) In this case the compiler will warn you if you typed the assignment operator (=) by mistake. About Sajo I love coffee! Tagged with: C++