OOPS

August 29, 2024

OOPS

August 29, 2024

OOPS

August 29, 2024

OOPS

August 29, 2024

OOPS

Question 191
Which of the following is not a member of class ?
A
Static function
B
Friend function
C
Const function
D
Virtual function
Question 191 Explanation: 
A friend function of a class is defined outside that class scope but it has the right to access all private and protected members of the class. Even though the prototypes for friend functions appear in the class definition, friends are not member functions.
1. A function can only be declared a friend by a class itself.
2. It can have access to all members of the class, even private ones.
Correct Answer: B
Question 191 Explanation: 
A friend function of a class is defined outside that class scope but it has the right to access all private and protected members of the class. Even though the prototypes for friend functions appear in the class definition, friends are not member functions.
1. A function can only be declared a friend by a class itself.
2. It can have access to all members of the class, even private ones.

Leave a Reply

Your email address will not be published. Required fields are marked *