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. main() {
  18. Derived d;
  19. return 0;
  20.  
  21. }
  22.  
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
Base Constructor called
Derived Constructor called