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 : Arthi
MFC Tips, C++ Tips, Visual C++ Tips,C++ Tutorials, MFC Tutorials,Visual C++ Tutorials
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;
}
}
0 nhận xét:
Post a Comment