Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- class test {
- friend void out (test const & t) ;
- private :
- int priv () const {
- return 10 ;
- }
- protected :
- int prot () const {
- return 20 ;
- }
- } ;
- void out (test const & t) {
- std::cout << t.priv () << '\n' ;
- std::cout << t.prot () << '\n' ;
- }
- int main () {
- out (test ()) ;
- return 0 ;
- }
Add Comment
Please, Sign In to add comment