Question: typedef struct { int foo; long bar; char bazz [ 6 ] ; } somestruct _ t; typedef struct { long foo; int count; short

typedef struct {
int foo;
long bar;
char bazz[6];
} somestruct_t;
typedef struct {
long foo;
int count;
short fizzle;
short faddle;
} astruct_t;
struct bazz {
somestruct_t field1;
astruct_t inner[4];
} gribble, probarray[5];
somestruct_t sarray[20];
For this problem, assume the compiler places the array sarray at address x, the struct gribble at
y, and probarray at z. Make your answers as concrete as possible (i.e., the only unknowns should
be x, y and z).
a. How many bytes will be occupied by the array sarray? How much of that, if any, is padding
added for alignment?

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 Programming Questions!