What is the syntax of friend function?
A. friend class1 Class2;
B. friend class;
C. friend class
D. None of the mentioned
Answer:A
What is the syntax of friend function?
A. friend class1 Class2; B. friend class; C. friend class D. None of the mentioned
Explanation:In option a, the class2 is the friend of class1 and it can access all the private and protected members of class1.