Question: 3. Pointers, objects and values. (a) Draw a diagram showing variable names, boxes and the contents of boxes created by the declarations below. For the
3. Pointers, objects and values. (a) Draw a diagram showing variable names, boxes and the contents of boxes created by the declarations below. For the array, also show the subscripts. Use an arrow to represent a pointer. int b, c = 10; int arr[3] = {8, 19, -2}; int *p = arr; int *q = &arr[1]; (b) What is stored in arr[3]? (c) What is stored in b after this assignment? b = *p * c + *q; (d) Diagram the contents of p and arr after this assignment: *p = *q; (e) What is stored in p after this assignment? p = q;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
