MCQOPTIONS
Saved Bookmarks
| 1. |
What is the problem with following code? #include int main() { int *p = (int *)malloc(sizeof(int)); p = NULL; free(p); } |
| A. | Compiler Error: free can't be applied on NULL pointer |
| B. | Memory Leak |
| C. | Dangling Pointer |
| D. | The program may crash as free() is called for NULL pointer |
| Answer» C. Dangling Pointer | |