C/C++ Compiler (cl.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
C4706
                                             Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
     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 ) ...
                                    -♦-