Possible Duplicate:
Is it good practice to NULL a pointer after deleting it?
My professor told us that it's good practice to set a pointer to 0 after we've deleted the allocated space it was pointing to and I've been trying to make a habit out of doing this. But when I do this, my compiler sends a warning my way:
Warning W8004 LinkedList.h 102: 'nPtr' is assigned a value that is never used in function LinkedList::remove(int)
I know warnings aren't the end of the world and my program will still compile, but my OCD just will not let it go. So I ask you more knowledgeable programmers:
Is it common to set a pointer to 0 after deleting it's node and is that really a good practice? Does it matter if I continue to let my programs compile with warnings such as this? Thanks to all answers!