Guest User

Untitled

a guest
Jul 18th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <iostream>
  2.  
  3.  
  4. class test {
  5. friend void out (test const & t) ;
  6. private :
  7. int priv () const {
  8. return 10 ;
  9. }
  10. protected :
  11. int prot () const {
  12. return 20 ;
  13. }
  14. } ;
  15.  
  16.  
  17. void out (test const & t) {
  18. std::cout << t.priv () << '\n' ;
  19. std::cout << t.prot () << '\n' ;
  20. }
  21.  
  22.  
  23.  
  24. int main () {
  25. out (test ()) ;
  26. return 0 ;
  27. }
Add Comment
Please, Sign In to add comment