C++ | friend keyword | Question 2
Predict the output the of following program.
(A) Compiler Error
(B) A::a=10 B::b=0
(C) A::a=0 B::b=0
Explanation: This is simple program where a function of class A is declared as friend of class B.
Since show() is friend, it can access private data members of B.
Quiz of this Question