delete pointers, but not the pointed object
I have a linked list, and in one of the functions I create a new object that points to one of the objects one the list.
Node* newPointer=new Node;
Is it possible to delete THE POINTER, and the pointer only Ė not the pointed object. If I write
then the object itself is deleted. I donít want to do that!
If it donít delete the newPointer will this lead to memory leakage?
Hope anyone can help me :)