C++ Programming :: Functions - Discussion
9 / 14
Friend function should be declared in the _________part of the class.
Apublic
Bprivate
Cboth (a) and (b)
Danywhere.
Show Explanation
To define a friend function, we will declare the function name preceded with keyword inside the class and function definition will be placed outside of the class.
A friend function can be invoked directly by using the function name.
It can be declared in Private and Public part of the class.
Asked In ::
A friend function is a regular function with its definition placed outside of any class. But a friend function when defined will have access to all private and public members of the class.
To define a friend function, we will declare the function name preceded with keyword inside the class and function definition will be placed outside of the class.
A friend function can be invoked directly by using the function name.
It can be declared in Private and Public part of the class.
Read Full Answer
Report Error
Please Login First Click Here