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.
C4130
                                             Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
     Compiler warning (level 4) C4130
 
     'operator ' : logical operation on address of string constant
 
     The operator was used with the address of a string literal.
     Unexpected code was generated.
 
     For example, the following code generates this warning:
 
          char *pc;
          pc = "Hello";
          if (pc == "Hello")
             { }
 
     The if statement compares the value stored in the pointer pc to
     the address of the string "Hello", which is allocated separately
     each time the string occurs in the code. The if statement does not
     compare the string pointed to by pc with the string "Hello".
 
     To compare strings, use the strcmp function.
                                    -♦-