02.11.2011, 20:46
hi..
I'm having a little problem..
I have this array:
and now I have this code
which returns this error (on the "for new n=0 ....." line)
so any ideas how to fix this?
(note, yes I need 3 dimensions in the array and no I will not change this..)
Am I doing the sizeof part wrong? 'cause that's how I would think it would work...
I'm having a little problem..
I have this array:
pawn Код:
enum Texts
{
maAR[10],
maRAY[50]
}
new MyArray[][][Texts] =
{
{
{"Hello", "This is an example"}
},
{
{"Hmm", "Hello again"}
}
};
pawn Код:
for(new n=0; n<sizeof(MyArray[0]); n++)
{
if(n == 0)
format(string, sizeof(string), "%s", MyArray[0][n][maAR]);
else
format(string, sizeof(string), "%s\n%s", string, MyArray[0][n][maAR]);
}
Код:
error 001: expected token: "]", but found "-integer value-" error 029: invalid expression, assumed zero error 029: invalid expression, assumed zero fatal error 107: too many error messages on one line
(note, yes I need 3 dimensions in the array and no I will not change this..)
Am I doing the sizeof part wrong? 'cause that's how I would think it would work...


