Advertisement
czlowiekzgon

Untitled

Nov 28th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. class B;
  2. class A {
  3. private:
  4. int a;
  5. public:
  6. A();
  7. ~A();
  8. friend void B::show(A&a);
  9. };
  10.  
  11. A::A() {
  12. cin >> a;
  13. }
  14. A::~A() {
  15.  
  16. }
  17.  
  18.  
  19.  
  20. class B {
  21. private:
  22.  
  23. public:
  24. B();
  25. ~B();
  26. void show(A &a);
  27. };
  28. void B::show(A &a) {
  29. cout << a.a << endl;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement