12.05.2013, 15:31
Strcmp is simply comparing two strings to eachother. In most other programming languages something like that would be
In pawn however this is not possible. Here you work with strcmp, what strcmp does it basically compare every character at X position to another character at X position from the other string. This process by itself is very slow.
ZCMD and most other command processors basically make the command a callback and use CallLocalFunction to call the command when someone types it in. This process by itself is much more effecient as it doesn't have to compare the characters, rather just calls the command directly.
That's why you should use ZCMD for commands and strcmp for other forms of string comparison.
Код:
if("string1" == "string1") { //do something }
ZCMD and most other command processors basically make the command a callback and use CallLocalFunction to call the command when someone types it in. This process by itself is much more effecient as it doesn't have to compare the characters, rather just calls the command directly.
That's why you should use ZCMD for commands and strcmp for other forms of string comparison.