I have this array
If I want to access item 1,2 in the array I do like this:Code:int array[3][4] = {{1,2,3}, {4,5,6}, {7,8,9}, {10,11,12}}; And and structure like this: struct database { int x_pos; int y_pos; int type_; int money; int credit; };
number_ = array[1] [2]
But since the array only can have 1 information item in it I have an problem.
I want an structure that I can access in an similar way as the array.
So, basically I want an [3] [4] array of the structure.
And I have no idea on how to do this, can you help me?
So when I for example want the information at location [1] [2] in the structure-array I could get the type_, money, credit etc from it.



LinkBack URL
About LinkBacks


