Find   


An Affiliate of AIHorizon




This tip submitted by Udhaya Kumar.D on 2005-09-07 02:09:27. It has been viewed 31861 times.
Rating of 3.2314 with 121 votes

Free The Memory That You Use



Clean up memory spaces that are no longer used.

function_t(int val)
{
char *msg = new char[30];

if(val == VALID)
{
//do processing....
}
else
{
//don't just return.clean the memory that was alloted.
delete [] msg;
return false;
}
}




More tips


Add a tip!



-----
Interested in advertising with us?
Please read our privacy policy.
Copyright © 1997-2005 Cprogramming.com. All rights reserved.