For this problem, you will be asked to write some code to accomplish a particula
ID: 3540596 • Letter: F
Question
For this problem, you will be asked to write some code to accomplish a particular task given the code fragment below. Each task will depend on the tasks that came before it. Your code must be syntactically correct.
int i1 = 100;
int i2 = -8;
int i3 = 15;
int *p1, **p2, ***p3, ****p4;
a) Set p1 to point to i1
b) Using p2 change the value of i1 to the value of i2.
c) Using p3 make p1 point to i3
d) What does the following code output? cout << *&*&**&*p2;
e) Using p4, dynamically allocate a 2d array of int ** with dimension of 3 rows and 4 columns.
f) Assign each element in p4 to the address stored by p2.
Explanation / Answer
a) p1=&i1; b)p2=&p1; **p2=i2; c)p3=&p2; **p3=&i3; d)15 e)p4=(int ****)calloc(3,4); f)int i=0; while(iRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.