Question: ( 2 0 pts ) In the example below, the row - pointer memory layout consumes 5 7 bytes for the characters themselves ( including

(20 pts) In the example below, the row-pointer memory layout
consumes 57 bytes for the characters themselves (including a NUL
byte at the end of each string), plus 28 bytes for pointers (assuming
a 32-bit architecture), for a total of 85 bytes.
char *days[]={
"Sunday", "Monday", "Tuesday",
"Wednesday", "Thursday",
"Friday", "Saturday"
};
This counts only the space devoted to characters and pointers,
which is appropriate if it is allocated statically as a global array of
days known at compile time. Suppose instead that space is
allocated in the heap, with 4 or 8 bytes of overhead for each
contiguous block of storage. How does this change the tradeoffs in
space efficiency?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!