Delete and NULL
| Thu, 2008-01-03 12:18 | |
|
|
hi all, void fun()when we deleted the pointer test Brajesh... Life is too short ! so do as many good things as you can do... |
| Thu, 2008-01-03 12:18 | |
|
|
hi all, void fun()when we deleted the pointer test Brajesh... Life is too short ! so do as many good things as you can do... |
Forum posts: 95
After deletion the pointer is set to NULL, to avoid any problem if it is deleted again by mistake.
Deleting a pointer twice, causes exception. Inorder to avoid this pointers are assigned to NULL after deletion. This is done to have robust program.
Chao,
Raghav
Forum posts: 132
It is only necessary *if* the pointer could be deleted again.
Many people do it in a destructor where it is totally unnecessary. Don't do it in a destructor.
Forum posts: 123
Thanks....
Life is too short ! so do as many good things as you can do...
Brajesh Kumar...
Beginner in Symbian C++