|
|
|||||
|
Get the Ebook
C Tutorial
Source Code
Function Reference
|
Pointer Memory allocationThis tip submitted by Krishnamoorthi on 2005-12-18 01:38:56. It has been viewed 15228 times.Rating of 6.8 with 122 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: free(Session); Session=NULL; 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. More tips Help your fellow programmers! Add a tip! Want to become a C++ programmer? The Cprogramming.com ebook, Jumping into C++, will walk you through it, step-by-step. Get Jumping into C++ today!
Custom Search
|
||||