12.09.2014, 12:55
Return values from the Wiki:
So if you want to check if strings are equal:
Not that if either one of them is empty, the function will say they're the same.
Quote:
-1 if string1 comes before string2 1 if string1 comes after string2 0 if the strings are the same (for the matched length). |
pawn Код:
if(strcmp(string1,string2) == 0) // Which is an equivalent of if(!strcmp(string1, string2))
{
// They are equal.
}
else // No point in using else if, not unless you care which one is first.
{
// They are different
}