Menu

Int C 75 Int D 100 Int R1 C Int R2 D C R2 Use Code Suppose Variable C Lives Memory Addres Q43890473

int c = 75;

int d = 100;

int& r1 = c;

int& r2 = d;

c++;

r2++;

Use the code above. Suppose the variable c lives at memoryaddress 512, and d lives at the memory address 1024. The size of aninteger is 4 bytes. After execution of the above code, drawlabelled boxes for each of the 4 variables c, d, r1 and r2, andshow their integer values. For r1 and r2, draw an additional arrowto where it points. Include addresses of boxes whereapplicable.

int w = 1;

int x = 2;

int* f = &w;

int* g = &x;

int y = 3;

int z = 4;

int& h = y;

int& i = z;

f = g;

h = i;

Draw labelled boxes for each of the 8 variables, and afterexecution of the above code show the contents of each box. Assume wlives at memory address 128, x lives at 256, y lives at 512, and zlives at 1024. In addition, draw arrows from f, g, h and i to wherethey point. Include addresses of boxes where applicable.

Expert Answer


Answer to int c = 75; int d = 100; int& r1 = c; int& r2 = d; c++; r2++; Use the code above. Suppose the variable c lives at memory…

OR