C++ Friend Question: Download Questions PDF
What is the syntax of friend function?
a) friend class1 Class2;
b) friend class;
c) friend class
d) None of the mentioned
![C++ Friend Interview Answer C++ Friend Interview Question](https://globalguideline.com/public/images/interview/8.png)
Answer:
a) friend class1 Class2;
Explanation:
In option a, the class2 is the friend of class1 and it can access all the private and protected members of class1.
Explanation:
In option a, the class2 is the friend of class1 and it can access all the private and protected members of class1.
Download C++ Friend Interview Questions And Answers
PDF