Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following C declaration: union U1 {float romo; double posey;}; union U2 {char cain; int posey;}; struct S { union U1 sf; union U2

Consider the following C declaration:

union U1 {float romo; double posey;}; union U2 {char cain; int posey;}; struct S { union U1 sf; union U2 giants; } s;

Assume that the machine has 1-byte characters, 4-byte integers, 8-byte floating numbers, and 16-bytedouble-precision floating numbers. Assume the compiler does not reorder the fields, and it leaves no holesin the memory layout.

a) (4pt) How many bytes does occupy?

b) If the memory address of s starts from 1000, what are the start addresses of s.u1.bands.u2.b?

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

Step: 3

blur-text-image

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

Define the purpose of a questionnaire.

Answered: 1 week ago

Question

8 Wis a te uny of ekin 8 Wis a te uny of ekin

Answered: 1 week ago