Friday, 5 July 2013

write one case where friend function is necessary | uses of friend function | can we make a class friend

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 



0 comments:

Post a Comment