Dangling Pointer Discussion

VIJAY CHAUHAN

VIJAY CHAUHAN

@vijay-chauhan-mlnYq1 Oct 19, 2024
What is a dangling name and Dangling Pointer????

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Whats In Name

    Whats In Name

    @whats-in-name-KdgM7o May 17, 2013

    A pointer points to some specific location in memory.
    Eg : 'a' is a pointer pointing to a memory address 4000 which is containing some data.
    After we delete the data which was at address 4000,it actually means address 4000 in memory is now a part of free memory pool which can be used for reallocation of some data.But a is still pointing to address 4000.In this case 'a' is a dangling pointer.

    To avoid the problem of dangling pointer after freeing memory address,we should point it to NULL.
  • VIJAY CHAUHAN

    VIJAY CHAUHAN

    @vijay-chauhan-mlnYq1 May 18, 2013

    Thanx friend 😀