Skip to content

Tag Archives: cpp-friend

Prerequisite: Friend Class in C++A friend class can access private and protected members of other classes in which it is declared as a friend. It… Read More
Pre-requisite: Friend FunctionCASE 1: Given two numbers a & b, swap these two numbers using the friend function of C++.  Examples:  Input : a = 5,… Read More
A friend class can access private and protected members of other classes in which it is declared as a friend. It is sometimes useful to… Read More
The idea of Encapsulation is to bundle data and methods (that work on the data) together and restrict access of private data members outside the… Read More