little problem with a structure of arrays

its a really begginer question. i started by myself a few days ago..

i have the following structure of arrays. im using it to store the dimensions of 3 different groups of 3 objects each but apparently the arrays are storing the data on the same address. (height2 overwrites height1, width2 overwrites width1 and so on)..

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  struct Volume
{
   int height1;
   int height2;
   int height3;
   int width1;
   int width2;
   int width3;
   int length1;
   int lenght2;
   int lenght3;
};

Volume arrVolume[3];
    


can someone explain me why it happens and how to solve this?

strange, can you show as the code?
Topic archived. No new replies allowed.