fork download
  1. #include <iostream>
  2. struct base {
  3. base() { std::cout << "base ctor" << std::endl; }
  4. };
  5. struct derived : public base {
  6. derived() { std::cout << "derived ctor" << std::endl; }
  7. };
  8. int main() {
  9. derived d;
  10. }
Success #stdin #stdout 0.02s 2680KB
stdin
Standard input is empty
stdout
base ctor
derived ctor