Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
delete a pointer
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="A, post: 4069736"] Here is one example where setting to null would have some use although I would say this is a bad practice and not very clean code - it can be probably restructured to be much cleaner: int *a = new Object(); a->DoStuff(); if (some event) { delete a; a = null; } // do something else if (a != null) { // code if object is still defined a->DoMoreStuff(); } else { // code if object is undefined, print error or whatever } [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
delete a pointer
Top