Posted by hr on July 26, 2000 at 11:39:25:
Hi I asked you this at the end of the class today, but.. I am still unclear about this?
supporse I have a some useless class like following
class blah
{
int a[102400];
};
now, if I declare class blah in a function like
void function1()
{
blah myblah;
//wait till i say ok to exit
}
and exit the function, it seems that the memory stays there. but if i do
void function2()
{
blah * myblah = new blah;
//wait till i say ok to exit
delete myblah;
}
in a different function and exit, memorty gets cleared.
i used Win2k's TaskManager to check the memory useage of my pathetic test program. i thought they both cleared class blah after exitting the function?