Hello all. There's a room script that creates several arrays of the same size.
int array_1[1000];
int array_2[1000];
int array_3[1000];
Is there a way to define the array size only once? The compiler doesn't seem to like the followingint limit = 1000;
int array_1[limit];
int array_2[limit];
int array_3[limit];
The error given is "Array size must be constant value.".
Yep, it wants a constant value.
Using #define should do the trick:
#define LIMIT 1000
int array_1[ LIMIT ];
int array_2[ LIMIT ];
int array_3[ LIMIT ];
Great, that's exactly what I was hoping was possible. Thanks a lot.