Question: 1 2 3 5 6 7 8 9 5. (20 points, C Data Placement on Stack, Pointers) Consider the following program. Assume that the register

 1 2 3 5 6 7 8 9 5. (20 points,

1 2 3 5 6 7 8 9 5. (20 points, C Data Placement on Stack, Pointers) Consider the following program. Assume that the register SP at the beginning points to OxOA00. Answer the following questions. Assume all variables are allocated on the stack, and in the order as they appear in the program ASCII code for character 'O' is 48. int main(void) volatile long int a = -67; volatile int c = -6, d = -5; 4 volatile char mych[4] = 1'0'2', '3' ); volatile long intolpa - ta; volatile int piedi Ipa = lpa - 2: *lpa - *lpa + 1026:// pi + 2 17 9 *pi- *pi + c 11 } Fill in the following table by determining the values/addresses given below. # Question? Value/Address 1 The number of bytes allocated on the stack for the variable declared in line 2 The number of bytes allocated on the stack for the character array declared in line 4. 3 The number of bytes allocated on the stack for all variables declared in lines 2-6. 4 Value of mych[0] after initialization performed in line 4. 5 Address of variable a (&a). 6 Value of Ipa at the moment after the statement in line 7 is executed. 7 Value of *pa at the moment after the statement in line 8 is executed. Value of mych[O) at the moment after the statement in line 8 is executed. Value of pi at the moment after the statement in line 9 is executed. 10 Value of *pi at the moment after the statement in line 10 is executed. N 8 9 (Note: The table below is not going to be graded; you can use it to sketch the stack if you want) 00 TOS Comments

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!