fork download
  1. #include <iostream>
  2. class PureAbstract {
  3. public:
  4. virtual void method() = 0;
  5. };
  6. void PureAbstract::method() { std::cout << "Hi from abstract\n"; }
  7.  
  8. class Derived : public PureAbstract {
  9. public:
  10. virtual void method() { PureAbstract::method(); }
  11. };
  12.  
  13. int main() {
  14. Derived d;
  15. d.method();
  16. }
Success #stdin #stdout 0.02s 2724KB
stdin
Standard input is empty
stdout
Hi from abstract