When I messed around with it myself, printing addresses, etc., I found that school[1] was 24 bytes after school[0] and that, within each struct, each element was 8 bytes away from the next... even though I have different data types such as char, char*, and int.Code:struct student { char id; char *name; int grade; }; int main () { struct student school[2]; school[0].id = 1; school[0].grade = 92; school[0].name = "roberto clemente"; school[1].id = 2; school[1].grade = 76; school[1].name = "bobby hillenbrand"; return 0; }
This leads me to believe that, within the structure, each element is actually a pointer to the value (obviously I would expect this of the element char *name, but not the others)... Is this incorrect? Because it seems awful weird.