fork(1) download
  1. #include<iostream>
  2. using namespace std;
  3. class bank
  4. {
  5. int a=0;
  6. cout<<"this is my bank"<<endl;
  7. friend class b;
  8. };
  9. class b
  10. {
  11. int b;
  12. public:
  13. void showA(bank &x)
  14. {
  15. cout<<"a="<<x.a;
  16. }
  17. };
  18. int main()
  19. {
  20. bank c;
  21. b d;
  22. d.showA();
  23.  
  24. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:6:2: error: ‘cout’ does not name a type
  cout<<"this is my bank"<<endl;
  ^~~~
prog.cpp: In function ‘int main()’:
prog.cpp:22:10: error: no matching function for call to ‘b::showA()’
  d.showA();
          ^
prog.cpp:13:7: note: candidate: void b::showA(bank&)
  void showA(bank &x)
       ^~~~~
prog.cpp:13:7: note:   candidate expects 1 argument, 0 provided
stdout
Standard output is empty