Nóta
Aðgangur að þessari síðu krefst heimildar. Þú getur prófað aðskrá þig inn eða breyta skráasöfnum.
Aðgangur að þessari síðu krefst heimildar. Þú getur prófað að breyta skráasöfnum.
Potential incorrect use of 'function1': Did you intend to use 'function2'?
Remarks
This warning indicates that a string copy function was used where a string comparison function should have been used. Incorrect use of the function can cause an unexpected logic error.
Code analysis name: STRCPY_INSTEAD_OF_STRCMP
Example
The following code generates this warning:
#include <string.h>
void f(char *title )
{
if (strcpy (title, "Manager") == 0) // warning C6324
{
// 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
}
}