Question: Given the following memory layout, trace through the provided code and show the printf output (assume no errors in code). Note: long is a 32
Given the following memory layout, trace through the provided code and show the printf output (assume no errors in code). Note: long is a 32 bit word, addresses are in hex, and the location content is decimal.

int main() {
long *p=12;
long **p1=12;
long ***p2=12;
printf("%d ", *p);
printf("%d ", *(p + 1));
printf("%d ", *(p - 1));
printf("%d ", **p1);
printf("%d ", (***p2)-1);
printf("%d ", &p);
printf("%d ", *((&p)-1));
printf("%d ", *(int)(((char *)p)+8);
printf("%d ", *p++);
printf("%d ", *--p);
}
Addr Content 112 0x00 40 0x04 20 0x08 32 0x0C 0x10 20 0x14 48 0x18 16 0x1C 0x20 16 36 0x28 40 0x2C 0x30 0x34 P1 0x38 P2 0x3C
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
