Question: Please help! 7.(20 pts) Consider the following code int a-3, b-5, *p-&a, p2 We can draw a diagram that shows the effect of this code
Please help!
7.(20 pts) Consider the following code int a-3, b-5, *p-&a, p2 We can draw a diagram that shows the effect of this code in memory, like this p2 Note that we are showing the contents of a and b, and we are showing where pl and p2 point. Since p2 is uninitialized, we show it pointing to a question mark (?). If a regular int variable were uninitialized, we would show a question mark (?) inside the box for the variable. Your job is to draw similar diagrams for the code below. Draw the diagrams as many times as needed for each question (that is, show all the intermediate steps). Please do not be messy and m ake your diagram very clear and readable int a=2, p3 = p2; *p1 = 8; p2pl; p1 = p3 ; *p2 = 4; b, *p1=&b, *p2=&a, *p3 ; int a=2, b-3, *p1, p2 = &a; p1 = &b; *p1 = *p1 + *p2 ; *p2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
