What are friend classes? What are advantages of using friend classes?

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 :
1. Provides additional functionality which is kept outside the class.
2. Provides functions that need data which is not normally used by the class.
3. Allows sharing private class information by a non member function.
What are zombie objects in C++?
What are zombie objects in C++? - An object creation of a class is failed before executing its constructor....
Difference between Stack and Queue - C++
Difference between Stack and Queue - Stack is a Last in First out (LIFO) data structure....
What is Stack? Explain its uses - C++
What is Stack? Explain its uses - Stack is a Last in First out (LIFO) data structure..
Post your comment