Partilhar via


C6324

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

warning C6324: potential incorrect use of <function1>: Did you intend to use <function2>?

This warning indicates that a string copy function was used where a string comparison function should have been used. Incorrect use of function can cause an unexpected logic error.

Example

The following code generates this warning:

#include <string.h>  
  
void f(char *title )  
{  
  if (strcpy (title, "Manager") == 0) // warning 6324  
  {  
    // code  
  }  
}  

To correct this warning, use strcmp as shown in the following code:

#include <string.h>  
  
void f(char *title )  
{  
  if (strcmp (title, "Manager") == 0)   
  {  
    // code  
  }  
}  

See Also

strcpy, wcscpy, _mbscpy
strcpy_s, wcscpy_s, _mbscpy_s
strncpy, _strncpy_l, wcsncpy, _wcsncpy_l, _mbsncpy, _mbsncpy_l
_mbsnbcpy, _mbsnbcpy_l
strcmp, wcscmp, _mbscmp
strncmp, wcsncmp, _mbsncmp, _mbsncmp_l
_mbsnbcmp, _mbsnbcmp_l