strcmp
#2

Return values from the Wiki:
Quote:

-1 if string1 comes before string2
1 if string1 comes after string2
0 if the strings are the same (for the matched length).

So if you want to check if strings are equal:
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
}
Not that if either one of them is empty, the function will say they're the same.
Reply


Messages In This Thread
strcmp - by AroseKhanNiazi - 12.09.2014, 12:50
Re: strcmp - by dusk - 12.09.2014, 12:55
Re: strcmp - by AroseKhanNiazi - 12.09.2014, 14:05

Forum Jump:


Users browsing this thread: 1 Guest(s)