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 friend function of C++.  Examples:  Input : a = 5, b… Read More
  Friend Class A friend class can access private and protected members of other class in which it is declared as friend. It is sometimes… 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