Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

Dangling Pointer in cpp

int *p = new int; // request memory
*p = 5; // store value

delete p; // free up the memory
// now p is a dangling pointer

p = new int; // reuse for a new address
 
PREVIOUS NEXT
Tagged: #Dangling #Pointer #cpp
ADD COMMENT
Topic
Name
6+9 =