B
Bikash
Hello,
I am a specific problem in exception handling. The code snippets is
attached below.
void f()
{
char *ptr = new char(20);
throw 2;
}
void main(void)
{
try
{
f();
}
catch(...)
{
}
}
The above function calls shows that a memory has been allocated to
char * pointer. With the throw statment in the subsequent line states
that there will be memory leak in this time of situation. I just
wanted to know is there any method to free the memory allocated in the
catch(...) block.
Regards
Bikash
I am a specific problem in exception handling. The code snippets is
attached below.
void f()
{
char *ptr = new char(20);
throw 2;
}
void main(void)
{
try
{
f();
}
catch(...)
{
}
}
The above function calls shows that a memory has been allocated to
char * pointer. With the throw statment in the subsequent line states
that there will be memory leak in this time of situation. I just
wanted to know is there any method to free the memory allocated in the
catch(...) block.
Regards
Bikash