Array of arrays access

 

Hello

I have an array of arrays of ints. I want to access a particular sub-array but compiler says: "Invalid array access". What am I doing wrong?

Please Note: I do NOT want to access individual elements of the sub-array


int             pattern[2][2] = {{-1,1},{1,-1}};

....

    int lTarget[] = pattern[0,0];
    if (gridObj.PatternMatch( lTarget) && !trig[idx[1]]) {

 
You can't get/access/write slices of arrays - only single elements.
 

Only arrays created in global space can be initialize some number and can have size.

Try like this.

 

int lTarget[];

ArrayResize(lTarget,1);

lTarget[0] = pattern[0,0];
Reason: