Assume you are given the following table of variables and th

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.

Solution

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
 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. Det

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site