Fixed 2D Arrays
Arrays allocated on the stack
Allocation:int fixed[50][100];
Access:fixed[5][10] = 1; or:fixed[0][5*100+9] = 1; or: fixed[1][4*100+9] = 1; etc..
Initialization example:Inefficient :for (i=0;iអi++) for (j=0;jj++) fixed[i][j] = 0;int *ptr = fixed[0];int *end = fixed[49]+99; *end = 0; /* or end = fixed+100 */while (ptr != end) *ptr++ = 0;
Passing to a functionFunction prototype:void foo(int fixed[50][100]); Function call: foo(vec);