Monday, February 23, 2009

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;
}
}

Author : Udhaya Kumar.D

0 nhận xét:

Post a Comment