Friend Function Program in C++
This C++ program demonstrates the use of keyword friend in classes. The program creates two classes ‘X’ and ‘Y’ and declares one class as ‘friend’ in another. By declaring friend, we mean that the friend class ‘Y’ will gain access to all the data members of the class ‘X’. The member functions of the friend … Read more