Question: Consider the following C program. #include int main ( void ) { int i [ 2 ] = { 2 , 4 } ; char
Consider the following C program.
#include
int mainvoid
int i;
char s ;
printfi p
i;
printfs p
s;
scanfs s;
printfixx
i;
printfixx
i;
printfs s
s;
return ;
Here are the printf outputs showing the addresses of the arrays in memory. The text following the two
printf outputs is what is typed at the keyboard for the scanf call.
$ aout
i xffdbdef
s xffdbdeec
Rise&ShoutBYU
Below are two tables displaying the contents of memory in hexadecimal. Each table shows memory in rows
of four bytes, with the address of the leftmost byte on each row shown to the left of the row. Addresses
increase as we move to the right and down in the image. On the left is memory before the input is scanned in
with indicating an unknown value. Your tasks will include identifying where things are on the memory
table on the left and also filling in the table on the right with the contents after the input.
Before scanf After scanf
Address Bytes Address Bytes
ec ec
f f
f f
f f
Which locations in the memory table contain the bytes for i
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
