Hi
I am developing a program in c++. Now, I have objects stored in heap space;
Graph *GR;
GR=new Graph(...)
The objects of type Graph in turn own binary trees of other objects also stored in heap, i.e..
Node *N.
N=new Node(...)
So the nodes have pointers to other nodes etc.
Now, I want to destroy the object GR and all the Nodes belonging to it. In java, one would just put =null, but that does not work in c++, right?
I am developing a program in c++. Now, I have objects stored in heap space;
Graph *GR;
GR=new Graph(...)
The objects of type Graph in turn own binary trees of other objects also stored in heap, i.e..
Node *N.
N=new Node(...)
So the nodes have pointers to other nodes etc.
Now, I want to destroy the object GR and all the Nodes belonging to it. In java, one would just put =null, but that does not work in c++, right?