Question: Consider a C struct that includes the following members: struct foo { char a; int b; bool c; double d; short e; float f; char
Consider a C struct that includes the following members:
struct foo
char a;
int b;
bool c;
double d;
short e;
float f;
char cptr;
double g;
float fptr;
;
a Note that for C language, the compiler keeps the elements of the struct in the same order as given in the struct definition. For a bit machine each word contains bytes or bits what is the size of the foo struct? Remember that data must be aligned on proper byte boundaries. That means, an byte element must start at a byte address that is a multiple of ; a byte value must start at an address that is a multiple of
b What is the minimum size required for this struct, assuming you may arrange the order of the struct members as you wish?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
