This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | Next revision Both sides next revision | ||
|
cpp:exception_inheritance [2020/05/04 12:04] gthanos |
cpp:exception_inheritance [2020/05/04 12:06] gthanos |
||
|---|---|---|---|
| Line 55: | Line 55: | ||
| } | } | ||
| } catch(BaseException ex) { | } catch(BaseException ex) { | ||
| - | cout << ex.what(); | + | cout << ex.message(); |
| } catch(DerivedException ex) { | } catch(DerivedException ex) { | ||
| - | cout << ex.what(); | + | cout << ex.message(); |
| } | } | ||
| return 0; | return 0; | ||
| Line 112: | Line 112: | ||
| } | } | ||
| } catch(BaseException &ex) { | } catch(BaseException &ex) { | ||
| - | cout << ex.what(); | + | cout << ex.message(); |
| } catch(DerivedException &ex) { | } catch(DerivedException &ex) { | ||
| - | cout << ex.what(); | + | cout << ex.message(); |
| } | } | ||
| return 0; | return 0; | ||