when we want that an object of a user defined type should be printed using cout then it is necessary to overload operator <<(). This function is decalred as friend in the class whose object we want to print.
yes, we can make the entire class as a friend then automatically all the member functions and data member of the class become friends .Hence we can access all of them
yes, we can make the entire class as a friend then automatically all the member functions and data member of the class become friends .Hence we can access all of them

0 comments:
Post a Comment