What are friend classes? What are advantages of using friend classes?
Page 1 of 1
What are friend classes? What are advantages of using friend classes?
The friend function is a ‘non member function’ of a class. It can access non public members of the class. A friend function is external to the class definition.
A friend function has the following advantages:
- Provides additional functionality which is kept outside the class.
- Provides functions that need data which is not normally used by the class.
- Allows sharing private class information by a non member function.
Similar topics
» What are the advantages of using friend classes?
» What is friend class in C++?
» What are the C++ standardized container classes?
» Define storage classes in C++.
» What are the advantages of inheritance?
» What is friend class in C++?
» What are the C++ standardized container classes?
» Define storage classes in C++.
» What are the advantages of inheritance?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|