Any performance improvement by using exception?

1
2
3
4
5
6
7
8
try
{
  int * myarray= new int[1000];
}
catch (bad_alloc&)
{
  cout << "Error allocating memory." << endl;
}


I am newbie in c++ programming, but I really don't find any goodness by doing this exception dealing, I cannot see any performance improvement comparing with using a "if" statement.

So, can anybody tell me, why do I need exception?
Exceptions are not there to improve performance, but to make your life easier and your application more robust.
Last edited on
Topic archived. No new replies allowed.