Examine these three declarations:
1: Cat FamilyOne 2: CAT * FamilyTwo; 3: CAT * FamilyThree = new CAT;
FamilyOne is an array of 500 CATs. FamilyTwo is an array of 500 pointers to CATs. FamilyThree is a pointer to an array of 500 CATs.
The differences among these three code lines dramatically affect how these arrays operate. What is perhaps even more surprising is that FamilyThree is a variant of FamilyOne, but it is very different from FamilyTwo.
This raises the thorny issue of how pointers relate to arrays. FamilyThree is a pointer to an array. That is, the address in the pointer FamilyThree is the address of the first item in that array. This is exactly the case for FamilyOne ...