fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Base {
  5. public:
  6. Base() {
  7. cout << "Base Constructor called" << endl;
  8. }
  9. };
  10.  
  11. class Derived : public Base {
  12. public:
  13. Derived() {
  14. cout << "Derived Constructor called" << endl;
  15. }
  16. };
  17.  
  18. main() {
  19. Derived d;
  20.  
  21. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
Base Constructor called
Derived Constructor called