fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Parent {
  5. public:
  6. virtual bool run() {return bar;};
  7. static bool foo() {return true;};
  8. static bool bar;
  9. };
  10.  
  11. class Child: public Parent
  12. {
  13. public:
  14. static bool foo() { return false;};
  15. };
  16.  
  17. int main() {
  18. // your code goes here
  19. Child c;
  20. bool bc = Child::foo();
  21. bool bp = Parent::foo();
  22.  
  23. std::cout << bc << bp;
  24. return 0;
  25. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
01