4. |
Which of the following is true about friend functions in C++?**
Please select the best answer.
|
|
A. |
A friend function is inherited by derived classes.
|
|
B. |
A friend function is a member of the class that declares it as a friend.
|
|
C. |
A friend function can be declared in multiple classes.
|
|
D. |
A friend function can access private and protected members of the class that declares it as a friend. |