Question: Consider the code: struct node * ptr ptr = (struct node *) malloc(sizeof (struct node)); printf(%p, ptr); // LINE 2; ASSUME THIS PRINTS Ox522f1co free(ptr)

Consider the code: struct node * ptr ptr = (struct node *) malloc(sizeof (struct node)); printf("%p", ptr); // LINE 2; ASSUME THIS PRINTS Ox522f1co free(ptr) printf("%p", ptr); // LINE 4 What happens when line 4 executes? It may crash (with segfault or other error meesage) It will print NULL. Nothing crashes. It will print the same as line 2 (0x522f1c0). Nothing crashes. O It will print a random memory address. Nothing crashes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
