Forum Discussion
Altera_Forum
Honored Contributor
9 years agoYou may check this
Code:
# define NUMBER_OF_ROWS 5
# define NUMBER_OF_COLS 4
static int myArray =
{
{5, 10, 15, 20},
{12, 10, 8, 8},
{24, 22, 20, 18},
{34, 32, 30, 29},
{46, 43, 43, 43}
};
void main(void)
{ int i, j;
printf("\n The contents of myArray are:\n");
for (i = 0; i < NUMBER_OF_ROWS; i++)
{ for(j = 0; j < NUMBER_OF_COLS; j++)
printf("%5d", myArray);
printf("\n");
}
}
But, since your rows and colums are not in sequence, so you may have either full lookup table (10 rows, 20 colums) or you need to divide your X and Y by specific value (rows divide by 2, colums divide by 5) to access the table