Is it possible to use char-array in multidimensional array? -
newbienoob - 24.02.2014
I'm trying to use multi-d array with char. But it somehow gives me an error(or warning).
pawn Код:
new var[MX_PLAYERS char][4];
var{playerid}[0] = 1; //warning/error
So it there any way to use char array in multi-d array?
Re: Is it possible to use char-array in multidimensional array? -
Mattakil - 24.02.2014
should be
Re: Is it possible to use char-array in multidimensional array? -
newbienoob - 24.02.2014
That wouldn't be char-array then.
Re: Is it possible to use char-array in multidimensional array? -
[FSaF]Jarno - 24.02.2014
Quote:
Originally Posted by Mattakil
|
You didn't even read the post, did you? He is trying to make a CHAR array, not a regular array!
Quote:
Originally Posted by newbienoob
I'm trying to use multi-d array with char. But it somehow gives me an error(or warning).
pawn Код:
new var[MX_PLAYERS][4];
var{playerid}[0] = 1; //warning/error
So it there any way to use char array in multi-d array?
|
Well, from what i can see, the array you have there is not a char array :3 (It's just a regular multi-d array. Perhaps actually adding the "char" in there would help? :3
Re: Is it possible to use char-array in multidimensional array? -
newbienoob - 24.02.2014
Oh wait, edited my main post. Was a mistake ;q
Re: Is it possible to use char-array in multidimensional array? -
Aerotactics - 24.02.2014
Quote:
Originally Posted by newbienoob
I'm trying to use multi-d array with char. But it somehow gives me an error(or warning).
pawn Код:
new var[MX_PLAYERS char][4];
var{playerid}[0] = 1; //warning/error
So it there any way to use char array in multi-d array?
|
Wouldn't "var{playerid}[0]" automatically be considered "1" hypothetically speaking, since arrays always count [0] as the first item?
Re: Is it possible to use char-array in multidimensional array? -
MP2 - 24.02.2014
Make the second dimension the char. Same memory used.
Re: Is it possible to use char-array in multidimensional array? -
newbienoob - 24.02.2014
So.. var[MAX_PLAYERS char][5 char] = Same memory used?
Re: Is it possible to use char-array in multidimensional array? -
Konstantinos - 24.02.2014
Not like that, it should be:
pawn Код:
new var[MAX_PLAYERS][4 char];
In bigger sizes, it makes difference.