Jump to content
Korean Random

rohanjoshi0894

Newbie
  • Content Count

    1
  • Joined

  • Last visited

Posts posted by rohanjoshi0894


  1. Dangling pointers arise when an object is deleted or de-allocated, without modifying the value of the pointer, so that the pointer still points to the memory location of the de-allocated memory. In short pointer pointing to non-existing memory location is called dangling pointer. 

    Example:

     

    #include<stdlib.h>
    {
        char *ptr = malloc(Constant_Value);
        .......
        .......
        .......
        free (ptr);      /* ptr now becomes a dangling pointer */
    }
    
×
×
  • Create New...