Compiler Warning (level 4) C4706

assignment within conditional expression

The test value in a conditional expression was the result of an assignment.

This warning is informational.

An assignment has a value (the value on the left side of the assignment) that can be used legally in another expression, including a test expression. However, the intention may have been to test a relation, not to make an assignment.

For example, the following line, which generates this warning, assigns b to a and compares the value of a with 0:

if ( a = b ) ...

However, the following line tests whether a and b are equal:

if ( a == b ) ...