Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

struct T { int *a; struct T* next; }; int *y; int **z; struct T x; struct T* p1; struct T* p2; struct T** p3;

struct T { int *a; struct T* next; }; int *y; int **z; struct T x; struct T* p1; struct T* p2; struct T** p3; 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]; x.a = *z; // 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 ; // point 8 z = x.a ; // point 9 free(x.a) // point 10 }

Find the locations that are garbage are ?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Moving Objects Databases

Authors: Ralf Hartmut Güting, Markus Schneider

1st Edition

0120887991, 978-0120887996

More Books

Students also viewed these Databases questions

Question

What changes, if any, are projected for this environment?

Answered: 1 week ago

Question

How have these groups changed within the last three years?

Answered: 1 week ago