1.

Which of the following should be used for freeing the memory allocated in the following C code?
#include <stdio.h>
struct p
{
struct p *next;
int n;
};
int main()
{
struct p *ptr1 = (struct ptr*)malloc(sizeof(struct p));
ptr1->n = 1;
ptr1->next = (struct ptr*)malloc(sizeof(struct p));
return 0;
}

A. free(ptr1);
B. All of above
C. None of these
Answer» D.


Discussion

No Comment Found

Related MCQs