Quote:
Originally Posted by baws
A string always uses the number under the number you used in it.
For example:
It will use:
I don't know if you get what i mean. But that's how it works ^
Another example:
PHP Code:
new String = "Baws";
It will be:
I always use a im-pair number when i set a new string as it will use the pair one and so on.
|
All cells are used. The last cell is filled with null (0).
This is to let natives know where to stop reading the string. If null was not used we would have to define the length to be read for ALL NATIVES.
Code:
server_print("Test", 4);
replace(Text, charsmax(Text), "Hello", 5, "What?", 5);
If null is missing there's a possibility that it will continue to read memory and you end up with something completely different from what you expected.
Like this:
Code:
new test1[] = { 'T', 'e', 's', 't', '1' };
new test2[] = { 'T', 'e', 's', 't', '2' };
server_print("%s", test1);
server_print("%s", test2);
__________________