multidimensional array: alternative?
#1

I'm making an include for something, and I need to address a multidimensional array within an enum. The following example will not work:

pawn Code:
// This, ofcourse, will not give any errors
#define ARRAY_SIZE 10
#define ENUM_SIZE 10

enum edata {
    E_DATA[ARRAY_SIZE]
}
new Enum[ENUM_SIZE][edata];

// This will not work, assuming "idx" is a valid index (Line 45)

Enum[idx][E_DATA[idx]] = someValue;

// This also gives some errors
Enum[idx][E_DATA][idx] = someValue;
Are there any alternatives for this? i'd like to keep the enum as this simplifies my problem. The errors are as followed:

Code:
C:~PATH~\~INCLUDE~.inc(45) : error 028: invalid subscript (not an array or too many subscripts): "E_DATA"
C:~PATH~\~INCLUDE~.inc(45) : warning 215: expression has no effect
C:~PATH~\~INCLUDE~.inc(45) : error 001: expected token: ";", but found "]"
C:~PATH~\~INCLUDE~.inc(45) : error 029: invalid expression, assumed zero
C:~PATH~\~INCLUDE~.inc(45) : fatal error 107: too many error messages on one line
Reply


Messages In This Thread
multidimensional array: alternative? - by Sinner - 02.08.2012, 12:36
Re: multidimensional array: alternative? - by Vince - 02.08.2012, 12:40
Re: multidimensional array: alternative? - by Sinner - 02.08.2012, 12:41

Forum Jump:


Users browsing this thread: 1 Guest(s)