Hi
I have this data store into a data structure.
i j x y w h w*h
0 0 0 0 9 11 99
1 0 0 11 9 10 90
2 0 0 21 9 11 99
0 1 9 0 8 12 96
1 1 9 12 8 7 56
2 1 9 19 8 6 48
3 1 9 25 8 7 56
0 2 17 0 7 8 56
1 2 17 8 7 8 56
2 2 17 16 7 8 56
3 2 17 24 7 8 56
0 3 24 0 8 6 48
1 3 24 6 8 7 56
2 3 24 13 8 6 48
3 3 24 19 8 7 56
4 3 24 26 8 6 48
Code:
struct data {
//Here
/*! horizontal position */
int x;
/*! vertical position */
int y;
/*! width */
int w;
/*! height */
int h;
/*! i'th rectangle in column */
int i;
/*! j'th column */
int j;
/*! total area */
int w*h;
} data
and then i have an array
/*! it contain group_id of each data line*/
int group_id[16]={0,0,0,0,3,3,1,1,1,3,3,2,2,2,2,1};
I never worked with 2D array before. My problem is that i want to create a 2D array of that data for example if i write data[j][i].. It will give me the reference/value of all data lines that belongs to j column, and same with group_id[j][i].
I don't know how i can store these structure vaules in this like 2D array.
Need your help..
Thanks