Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assume you are given the following table of variables and their addresses. int a

ID: 3933885 • Letter: A

Question

Assume you are given the following table of variables and their addresses. int a, *p, **pp; The following are initial values for the following expressions. Determine the values of the variables after the execution of each C statement(s). The changes are cumulative; that is, the previous lines affect the variables on the current line. Recall that an int requires 4 bytes of storage, thus int addresses increment by 4. Furthermore, pointer addresses are stored as int. Note that space has been given to you in the table above to keep track of the new values after each command.

Explanation / Answer

command 1 : --pp;

command 3: --p;

a = **(++pp)/2

a p pp *p *pp **pp

command 1 : --pp;

1 40 48 1 44 2 command 2: p=*pp++; 1 44 52 2 40 1

command 3: --p;

a = **(++pp)/2

4/2=2 40 56 1 36 4
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote