Catch Multiple Custom Exceptions? - C++

前端 未结 7 1454
我在风中等你
我在风中等你 2020-12-24 10:44

I\'m a student in my first C++ programming class, and I\'m working on a project where we have to create multiple custom exception classes, and then in one of our event handl

7条回答
  •  一整个雨季
    2020-12-24 10:59

    Derive all of your exceptions from a common base class BaseException that has a virtual method GetMessage().

    Then catch(const BaseException& e).

提交回复
热议问题