Pointer Memory allocationThis tip submitted by Krishnamoorthi on 2005-12-18 01:38:56. It has been viewed 21066 times.
Rating of 5.5 with 188 votes
When ever you deallocate the memory reset the pointer to NULL to make sure that you do not use a dangling pointer. For example:
Now if you try to use Session, then it will crash your program immediately, rather than using invalid memory, which will cause very hard-to-find problems.
Help your fellow programmers! Add a tip!