Esempio
La prima istruzione if potrebbe controllare se gli argomenti sono uguali, ma riesce sono se questi sono differenti.

void foo( char *string1, char *string2)
{
if( strcmp(string1, string2) ) {
//the strings are the different
}

if( !strcmp(string1, string2) ) {
//the strings are the same
}
}

Soluzione
Per evitare questo problema, una linea guida del codice potrebbe richiedere che le istruzioni if vengano scritte come riportato di seguito.

void foo( char *string1, char *string2)
{
if(strcmp(string1, string2) != 0) {
//the strings are the different
}

if( strcmp(string1, string2) == 0) {
//the strings are the same
}
}