Dangling pointer

Posted by viswanathan on Stack Overflow See other posts from Stack Overflow or by viswanathan
Published on 2010-04-26T07:03:34Z Indexed on 2010/04/26 7:13 UTC
Read the original article Hit count: 229

Filed under:
|

How can the below code result in a dangling pointer.

{
    char *cPointer = malloc ( some constant number );
    /* some code */
    free ( cPointer );      
    cPointer = NULL;        
    /* some code */
}

© Stack Overflow or respective owner

Related posts about c++

Related posts about pointers