Question: Answer the following for the structure declaration A. What are the byte offsets of all the fields in the structure? B. What is the total

Answer the following for the structure declaration

struct { int *a; float b; char C; short d; long e; double f; int char } rec; g; *h;

A. What are the byte offsets of all the fields in the structure?

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.

struct { int *a; float b; char C; short d; long e; double f; int char } rec; g; *h;

Step by Step Solution

3.45 Rating (148 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

This is an exercise in understanding structure layout and al... View full answer

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 Computer Systems A Programmers Perspective Questions!