tmp = strtok(text, idx);
#7

Quote:
Originally Posted by Sreyas
Посмотреть сообщение
your reply and his problem is not connected and using 256 as cell size is like wasting and it makes the compiler slow too a god programmer should know the processing compotent well and should make its working ease
And
Код:
new name[20 char]
is wrong
It's not wrong.

Quote:
Originally Posted by sheNdjze
Посмотреть сообщение
AndySedeyn i've read this topic, its interesting but i still didn't understend, i should use like this?
new name[20 char]; with the chars in the text or? can you explain me better maybe or i'm right? like i got this
new name[20 char];
(blabla, "%s joined the server", name);
If you want to pack your string, then yes, use char. It's trivial in this case, so you can leave it as it is:
PHP код:
new name[43]; // (20 - 2) for the actual size and 24 for the player's name + \0 
A brief explanation on what packed strings exactly are/do is also in the tutorial:
Quote:
Originally Posted by tutorial
Regular strings store one character per cell and a cell is 4 bytes long (making 256 long strings exactly a kilobyte in size), packed strings store 4 characters per cell
Reply


Messages In This Thread
tmp = strtok(text, idx); - by saket - 05.04.2016, 15:07
Re: Help!! tmp = strtok(text, idx); - by sheNdjze - 05.04.2016, 15:30
Re: Help!! tmp = strtok(text, idx); - by AndySedeyn - 05.04.2016, 15:37
Re: Help!! tmp = strtok(text, idx); - by SyS - 05.04.2016, 15:41
Re: Help!! tmp = strtok(text, idx); - by sheNdjze - 05.04.2016, 15:47
Re: Help!! tmp = strtok(text, idx); - by SyS - 05.04.2016, 15:51
Re: Help!! tmp = strtok(text, idx); - by AndySedeyn - 05.04.2016, 15:59
Re: Help!! tmp = strtok(text, idx); - by Crayder - 05.04.2016, 16:12
Re: tmp = strtok(text, idx); - by saket - 06.04.2016, 05:43

Forum Jump:


Users browsing this thread: 3 Guest(s)