Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q 3 . For the structure declaration: struct { char * a; short b; double c ; chard; float e; char f; long Jeag g

Q3. For the structure declaration:
struct {
char * a;
short b;
double c;
chard;
float e;
char f;
long Jeag g :
void ?**h;
} foo;
Suppose the structure was compiled on a 32-bit Windows or a 32-bit UNIX
machine, where each primitive data type of K bytes must have an offset that
is a multiple of K.
B. What is the total size of the structure?
C. Rearrange the fields of the structure to minimize wasted space, and then
show the byte offsets and total size for the rearranged structure. [10 marks]
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Real Time Database Systems Architecture And Techniques

Authors: Kam-Yiu Lam ,Tei-Wei Kuo

1st Edition

1475784023, 978-1475784022

More Books

Students also viewed these Databases questions

Question

What are three myths about mindfulness?

Answered: 1 week ago

Question

Why are there two stages of allocation in activity-based costing?

Answered: 1 week ago

Question

Differentiate 3sin(9x+2x)

Answered: 1 week ago

Question

Comment should this MNE have a global LGBT policy? Why/ why not?

Answered: 1 week ago