Question: Problem 3 . Given the following declarations: typedef struct { int foo; long bar; char bazz [ 6 ] ; } somestruct _ t; typedef
Problem Given the following declarations:
typedef struct
int foo;
long bar;
char bazz ;
somestructt;
typedef struct
long foo;
int count;
short fizzle;
short faddle;
astructt;
struct bazz
somestructt field;
astructt inner ;
gribble, probarray ;
somestructt sarray ;
For this problem, assume the compiler places the array sarray at address the struct gribble at and probarray at Make your answers as concrete as possible ie the only unknowns should be and
a How many bytes will be occupied by the array sarray? How much of that, if any, is padding added for alignment?
b Is it possible to cahnge the definition of somestructt to reduce the amount of padding in sarray? You may not change the types of the fields.
c How many bytes will be occupied by the variable gribble? Note: the correct answer will be what is returned by sizeof gribble
d What can you say about the address of the variable gribble?
e What is the address of sarray bar?
f What is the address of the field probarrayinnerfizzle?
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
