fork download
  1. #include <iostream>
  2. using namespace std;
  3. class clsStudent
  4. {
  5. public:
  6. virtual void display() = 0;// {cout<<"Student\n";}
  7. virtual void identifyingNumber() = 0;
  8. };
  9.  
  10. class clsInternational : public clsStudent
  11. {
  12. public:
  13. void display(){cout<<"International\n";}
  14. void identifyingNumber(){cout<<"Pass\n";}
  15. };
  16.  
  17. class local : public clsStudent
  18. {
  19. public:
  20. void display(){cout<<"International\n";}
  21. void identifyingNumber(){cout<<"IC\n";}
  22. };
  23.  
  24.  
  25. int main()
  26. {
  27. clsStudent * s = new clsInternational;
  28. clsStudent * s2 = new local;
  29.  
  30. s->display();
  31. s->identifyingNumber();
  32.  
  33. s2->display();
  34. s2->identifyingNumber();
  35.  
  36. return 0;
  37. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
International
Pass
International
IC