dangling pointer

English

Examples
  • A wild pointer, which may be used interchangeably with dangling pointer (sense 1):
char* dp;  // dp is immediately dangling as it is uninitialized
  • A pointer to memory that has gone out of scope (sense 2):
    {
        char* dp = NULL;
        {
            char c;
            dp = &c;
        } 
        // c falls out of scope,
        // so dp is now a dangling pointer
    }
    

Noun

dangling pointer (plural dangling pointers)

  1. (programming, loosely) A pointer (variable that holds the address of a memory location) that does not reference a valid object.
    Synonym: wild pointer
  2. (programming, strictly) A pointer referencing memory that was previously deallocated.

Translations