To me an array of a structure or class seems a lot more clear to understand than a 2 dimenstional array. After all, when the array is of type struct, the structure member data ( which is like the second dimension in a 2 dimenstional array ) is accessed by a name rather than a index number making it easier to understand read, and code. Example:
is accessed p1[0].age = 12;Code:struct PersonalInfo { int age, yearOfBirth; } p1[2];
as opposed to:
is accessed personalInfo[0] [0] = 12;Code:int personalInfo[2] [2];
Am i right?
Is there any time that using a 2 dimensional array would be more advantageous than using an array of a structure/class (besides saving lines of code)