Question: For each of the following structure declarations, determine the offset of each field, the total size of the structure, and its alignment requirement for x86-64:
For each of the following structure declarations, determine the offset of each field, the total size of the structure, and its alignment requirement for x86-64:
![A. struct P1 { short i; int c; int *j; short *d; }; B. struct P2 { int i[2]; char c [8]; short s [4]; long](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1698/1/4/4/5956537a153509931698144593144.jpg)
A. struct P1 { short i; int c; int *j; short *d; }; B. struct P2 { int i [2]; char c [8]; short s[4]; long *j; }; C. struct P3 { long w [2] ; int *c [2] }; D. struct P4 { char w [16]; char *c [2] }; E. struct P5 { struct P4 a [2]; struct P1 t };
Step by Step Solution
3.39 Rating (158 Votes )
There are 3 Steps involved in it
Understanding structure layout and alignment is very important ... View full answer
Get step-by-step solutions from verified subject matter experts
