Q47
What will happens if the statement free(a) is removed in the following C code? #include #include main() int *a; a=(int*)malloc(sizeof(int)); *a=100; printf("*a%d",*a); free(a); a=(int*)malloc(sizeof(int)); *a=200; printf("a%p",a); *a=200; printf("a%d",*a);
A.
Error
B.
Memory leak
AnswerC.
Dangling pointer arises
D.
200 is printed as output
Answer: Option B
Solution
Answer: Option B
No explanation is given for this question Let's Discuss on Board