fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class A {
  6. int a;
  7. public:
  8. A(int a = 0):a(a){}
  9. int get() { return a; }
  10. };
  11. class B :public A
  12. {
  13. int b;
  14. public:
  15. int get() { return b; }
  16. };
  17.  
  18. void F() {
  19. A* a = new B();
  20. }
  21.  
  22. int main(){}
  23.  
  24.  
Success #stdin #stdout 0s 5016KB
stdin
Standard input is empty
stdout
Standard output is empty