Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
400 B
2
Indexable
Never
/* 
* Cource: CS2313
* Term: Fall 22
* Student: Kevin Huy Trinh
*
* Assignment: #11
*/

#include<iostream>

using namespace std;

class Base {};
class Derived: public Base {};

int main()
{
   Derived z;

   try {
       throw z;
   }
   catch(Derived z) {
        cout<<"Caught Derived Exception";
   }
   catch(Base b) {
        cout<<"Caught Base Exception";
   }
   getchar();
   
   return 0;

}