SA-MP Forums Archive
null terminator and strlen - 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: null terminator and strlen (/showthread.php?tid=379139)



null terminator and strlen - marquezsanchez - 20.09.2012

hi i want know when I create un new string :

new str[26];

i have 25 character to use and 1 for null terminator ; when i use strlen() , its return 26 ou 25 characters??


Re: null terminator and strlen - ViniBorn - 20.09.2012

strlen returns the number of characters used

sizeof returns the number of characters declared


Re : null terminator and strlen - marquezsanchez - 21.09.2012

ah ok thx