A dangling pointer points to memory that has already been freed. The storage has been freed or variable been assigned the memory has it's life time ended, in other words storage no longer allocated. Now a pointer which is still holding the address of the same memory location which has been freed tries to access it causes segmentation fault to happen.
int *x=(int *) malloc(4);
*x=10; //THIS will cause the segmentation fault