Q) What is the problem with the following code:
#include <stdio.h>
int main()
{
int *ptr = (int *)malloc(sizeof(int));
ptr = NULL;
free(ptr);
}
Doubt from pointers
Please provide with the question.
Q) What is the problem with the following code:
#include <stdio.h>
int main()
{
int *ptr = (int *)malloc(sizeof(int));
ptr = NULL;
free(ptr);
}
Please provide with the question.