A pointer pointing to a memory location that has been deleted (or freed) is called dangling pointer.
#include
#include
void main()
{
int *ptr = (int *)malloc(sizeof(int));
// After below free call, ptr becomes a
// dangling pointer
free(ptr);
}
for more information click HERE