Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

C6324

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

Community Additions

ADD
Show:
© 2015 Microsoft