+ 2
What is the main reason of using a friend class?
7 odpowiedzi
+ 3
so that we can access private properties of a class
+ 3
as its name suggests friend function provides us a gateway to access the private members of a class
+ 1
friend is a special mechanism for letting non member functions access private data. A Friend function can be either declared or defined within the scope of a class definition.
+ 1
OK. thanks all
+ 1
We normally use friend functions when we have to link data between two different classes ( in few cases inheritance isn't required as all the properties of one class aren't need by the other)
0
OK. thanks all
0
yes.. pramod