Skip to content

Tag Archives: Friend function and class

Friend Function: It is basically a function that is used to access all private and protected members of classes. It is considered as a non-member… Read More
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
Predict the output of following program. #include <iostream> using namespace std; class A { protected:     int x; public:     A() {x = 0;}     friend void show();… Read More