#include<iostream> using namespace std; class Base {}; class Derived: public Base {}; int main() { Derived d; // some other stuff try { // Some monitored code throw d; } catch(Base b) { cout<<"Caught Base Exception"; } catch(Derived d) { //This ... derived class object but base class exception is caught can anyone explain how it is happened internally . and what is class Derived: public Base {};
asked
Feb 9, 2019
in Programming
shiva0
250 views