Answered step by step
Verified Expert Solution
Question
1 Approved Answer
At point 10, the locations of dangling references are? A.) y B.) x C.) x.a D.) z E.) a[0], a[1], a[2] F.) none of the
At point 10, the locations of dangling references are?
A.) y
B.) x
C.) x.a
D.) z
E.) a[0], a[1], a[2]
F.) none of the above
At point 10, the locations that are garbage are?
A.) m8
B.) m9
C.) m10
D.) m11
E.) m12
F.) none of the above
struct T int *a; struct T* next; }; int *y; int **Z; struct T X; struct T* p1; struct T* P2; struct T** p3; m1 next m2 10 m11 m3 N m12 TOL m8 X.a a[0] a(1) a[2] m9 m10 int main(). { p1 = (struct T*) malloc(sizeof(struct T)); p2 = &x; y = (int *) malloc(sizeof(int)); { int* a[3]; a[1] = (int *) malloc(sizeof(int)); z = &a[1]; = *z; 1/ point 1 (*p1). a = z; // point 2 } (*p1). next = p1; // point 3 p2 = p1; // point 4 p3 &p1; // point 5 p3 *(&p3); // point 6 P3 = &(*p3); // point 7 x.a-y; 1/ point 8 // point 9 free(x.a) // point 10 } m7 m4 a p1 OJO 10110110 next m7.1 m7 m5 p2 Z = X.a ; m6 p3
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started