/* * A struct is a record consisting of a number of fields. There is no memory * overhead for a struct, except for the purposes of memory `alignment.' * * Jed Yang */ #include struct Student { int id; char *name; double gpa[12]; }; int main(void) { struct Student s; printf("s\t%p %li\n", &s, sizeof(s)); printf("s.id\t%p %li\n", &s.id, sizeof(s.id)); printf("s.name\t%p %li\n", &s.name, sizeof(s.name)); printf("s.gpa\t%p %li\n", &s.gpa, sizeof(s.gpa)); return 0; }