fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Base
  5. {
  6. protected:
  7. void func1();
  8. };
  9.  
  10. class Derived : public Base
  11. {
  12. friend class Third;
  13. };
  14.  
  15. class Third
  16. {
  17. void foo()
  18. {
  19. Derived d;
  20. d.func1();
  21. }
  22. };
  23.  
  24. int main() {
  25. // your code goes here
  26. return 0;
  27. }
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
Standard output is empty