What is friend function?

Answer Posted / mital

A friend function is used in object-oriented programming to
allow access to private or protected data in a class from
outside the class. Normally a function which is not a
member of a class cannot access such information; neither
can an external class. Occasionally such access will be
advantageous for the programmer; under these circumstances,
the function or external class can be declared as a friend
of the class using the friend keyword. The function or
external class will then have access to all information –
public, private, or protected – within the class.

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is react oop?

609


Why is abstraction used?

604


What is encapsulation and abstraction? How are they implemented in C++?

637


What is interface in oop?

662


i got a backdoor offer in process global,Bangalore..Can i work with it?

2324






What is polymorphism and its types?

595


Is data hiding and abstraction same?

567


assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).

1662


What is the difference between a constructor and a destructor?

613


Can abstract class have normal methods?

612


What are constructors in oop?

592


What is constructor in oop?

587


What are the 4 pillars of oop?

670


which feature are not hold visual basic of oop?

1723


What is abstraction encapsulation?

657