Guest User

Untitled

a guest
Jul 17th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template <typename T>
  5. class A
  6. {
  7. public:
  8. class B
  9. {
  10. T k; friend class A;
  11. public:
  12. T getK () { return k; }
  13. };
  14.  
  15. B myB;
  16.  
  17. void changeB( T z )
  18. { myB.k = z; }
  19. };
  20.  
  21. int main()
  22. {
  23. A<int> a;
  24. a.changeB(10);
  25. cout << a.myB.getK() << endl;
  26. }
Add Comment
Please, Sign In to add comment