Question: ( 3 0 points, submit on paper in class ) For each of these structure definitions, show the relative offset in bytes of each structure

(30 points, submit on paper in class) For each of these structure definitions, show the relative offset in bytes of each structure member for both the unpacked (default alignment) and packed cases. Also show the size of the structure in bytes. For each, write the structure definition with the offsets and total size (in bytes) next to the corresponding fields like this example:
offsets
structure s unpacked packed
char a; 0
int b;,4
char c; 8
short d; ,10,6
};
128 size of structure in bytes
(a)
struct student {
char first [15];
char last [15];
double gpa;
int creditHours;
};
(b)
struct course {
char dept [5] ;
short number [5] ;
char section [4];
int enrollment;
};
 (30 points, submit on paper in class) For each of these

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!