Question: This uses C please help me i have 2 hours to submit Consider this block of code below. Trace the following code as explained in
This uses C please help me i have 2 hours to submit
Consider this block of code below. Trace the following code as explained in class. Show the starting address, the intermediate and final values of the variables. A variable of type 'int' takes 4 bytes and any pointer variable takes 8 bytes of space. Assume the starting address that is available is 1000 (calculate in decimal). For each of the starting addresses S-1 to S-10, there is only one number, please write that down. However, for each of the variable values V-1 to V-10, there can be more than one values (starting, intermediate and final). Write all of them down, separated by comma. For example, if V-4 has 3 values then write them down as V-4 = 1, 2, 3. You DON'T need to create a table for your answer. Just mention in each separate line, variable name = answer. For example, S-1 = 1 S-2 = 2 and so on... int x = 0, y = 2, Z = Starting address location is 1000 (calculate in decimal) int *p; int **pp; Variable Name Starting Address Value int arr (5) = { 1, 2, 3, 5, 9 }; X S-1 V-1 Y S-2 V-2 ++*p; Z S-3 V-3 p = &arr[0]; 'O S-4 V-4 arr[*p++] = 20; op S-5 V-5 * ++ = 10; arr[0] S-6 V-6 p = GY; arr[1] S-7 V-7 pp = p; arr [2] S-8 V-8 arr[++**pp++] = 30; arr [3] S-9 V-9 arr[4] S-10 V-10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
