01.04.2015, 17:20
You can't store several pieces of data in a variable, that's why we use arrays for containing words.
Each variable can store 1 piece of data.
You cannot do
It's the same with arrays, but they're like several variables.
You could say using Array[3] contains 3 "variables".
Which is the same as just doing
If the array is declared using
Because each "number" is like 1 variable, so here we have 3 variables, which and can store 1 piece of information each.
The reason we need 3 is because of the null constant, AKA "\0", it tells the compiler that the string ends where the null symbol is.
You can read more in this tutorial:
https://sampforum.blast.hk/showthread.php?tid=318212
Each variable can store 1 piece of data.
pawn Код:
Var1 = "H";
Var2 = "i";
pawn Код:
Var = "Hi";
You could say using Array[3] contains 3 "variables".
pawn Код:
Array[0] = "H";
Array[1] = "i";
Array[2] = "\0";
pawn Код:
Array = "Hi";
pawn Код:
new Array[3];
The reason we need 3 is because of the null constant, AKA "\0", it tells the compiler that the string ends where the null symbol is.
You can read more in this tutorial:
https://sampforum.blast.hk/showthread.php?tid=318212