locked
using catch (...) vs catch (Exception * error) RRS feed

  • Question

  • Why would one use catch (...) over catch (Exception * error)? I know (...) catches all exception types but what exceptions would this be that (Exception* error) wouldn't catch? In (...), what would I use to display the error message? I'm coding in VC++.NET 2003 and .NET 2005.

    Wednesday, May 9, 2007 9:08 PM

Answers

  • If you are using the .net framework ie managed C++ or C++/CLI then you wouldn't really gain anything out of doing catch(...) since all .net exceptions are derived from the Exception class.

    Wednesday, May 9, 2007 10:59 PM