fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class A
  5. {
  6. public:
  7. virtual int Foo() { return 42;}
  8. };
  9.  
  10. class B : public A
  11. {
  12. public:
  13. int Foo;
  14. };
  15.  
  16. int main() {
  17. B b;
  18. b.Foo=1;
  19. //b.Foo() - Ошибка имя Foo перекрыто
  20. // your code goes here
  21. return 0;
  22. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
Standard output is empty