Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write out the memory map for following code, providing allvalues at the end of execution. (b)How many total bytes does this code declare for variables??(5)

Write out the memory map for following code, providing allvalues at the end of execution.
(b)How many total bytes does this code declare for variables??(5)

#include
typedef struct amount {
int dollars;
char cents;
}money;
main( )
{
money a, *b;
a.dollars = 1;
a.cents = 99;
b=&a;
b-->cents = 75;
}

(a) eg. table
Lable Address Value
a.dollars 0 -4 1
a.cents 5 - 9 99
:
:
(b) eg. int dollars = 4 bytes & char cents = 1 byte thereforemoney = 5 bytes
variable a = 5 byte
variable b is a pointer therefore b = 4 bytes

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

Computer Architecture A Quantitative Approach

Authors: John L. Hennessy, David A. Patterson

4th edition

123704901, 978-0123704900

More Books

Students also viewed these Databases questions

Question

=+a) Comparing the ratings of a new telephone set on a

Answered: 1 week ago