Question
Assume that you are working on a system where a char takes 1 byte of memory, an int takes 4 byes of memory, a double
Assume that you are working on a system where a char takes 1 byte of memory, an int takes 4 byes of memory, a double takes 8 bytes of memory, and a pointer takes 12 bytes of memory.
Consider the following array declaration:
int * foo [ 8 ] [ 6 ];
Assume that the memory for this array is allocated starting at memory address 0x00000000000000000000B2F5 (i.e., decimal 45,813)
Assume that the program initializes all the entries in the array (perhaps reading the values from a file).
Consider the statement:
printf ( "%c", foo[5][2] );
What is the memory address of the value that is being printed here? SHOW THE EXACT CALCULATIONS that are carried out by the system to determine this address.
If this code would generate a compiler error or warning, or would crash the program during execution, then state that fact.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started