SA-MP Forums Archive
why strtok shouldn't be used? And why sscanf should use the plugins not the pawn version? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: why strtok shouldn't be used? And why sscanf should use the plugins not the pawn version? (/showthread.php?tid=440996)



why strtok shouldn't be used? And why sscanf should use the plugins not the pawn version? - yxliang - 01.06.2013

I just curious about that. Actually, ZCMD can use strtok to handle the parameters.


Re: why strtok shouldn't be used? And why sscanf should use the plugins not the pawn version? - Emmet_ - 01.06.2013

There are no problems with strtok. However, it's outdated (created in early 2000's) and several better methods have been created such as sscanf, etc that are better and easier to use than strtok.


Re: why strtok shouldn't be used? And why sscanf should use the plugins not the pawn version? - JaKe Elite - 01.06.2013

strtok is slow and sscanf is fast. Current, sscanf is the fastest string splitter at the moment.
But i can't explain you why sscanf use plugin, and why strtok is slow.