What is a friend function & its advantage?



What is a friend function & its advantage?..

Answer / kishor khatri

A friend function is a non member function of a class, that
is declared as a friend using the keyword "friend" inside
the class. By declaring a function as a friend, all the
access permissions are given to the function. It is like
allowing access to ones personal belongings to a friend.

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More OOPS Interview Questions

Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.

0 Answers  


Can private class be inherited?

0 Answers  


What is difference between data abstraction and encapsulation?

0 Answers  


Can we create object of class with private constructor?

5 Answers  


what is a binary overloading

2 Answers  






Can destructor be overloaded?

0 Answers  


How to hide the base class functionality in Inheritance?

0 Answers   Viscus Infotech,


What is the main feature of oop?

0 Answers  


to remove the repeated numbers from the given . i.e.., if the input is 12233 output should of 123

2 Answers  


Can we override main method?

0 Answers  


what is function over loading?

5 Answers  


What are functions in oop?

0 Answers  


Categories