[Question] Strcmp
#1

Whats the difference between:

if(strcmp)cmd, "command, true) == 0)

AND

if(strcmp)cmdtext, "cmd", true, 10) == 0)

AND

if(strcmp)"/cmd", cmdtext, true) == 0)

etc etc, is there a difference? Functions?
Reply
#2

pawn Код:
if(!strcmp("/command",cmdtext,true))
if(!strcmp(cmdtext,"/command",true))
Same thing. Like if you say "USA vs China" or "China vs USA".
Reply
#3

it also affects the return value if they are not equal
from String_Manipulation.pdf

The return value is:
−1 if string1 comes before string2,
1 if string1 comes after string2, or
0 if the strings are equal (for the matched length).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)