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 oop better than procedural?

562


what is difference between class template and template class?

2153


What is the point of oop?

644


What are the components of marker interface?

598


What is the importance of oop?

605






Can private class be inherited?

615


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 pure oop?

592


Why do we need polymorphism in c#?

680


Why is static class not inherited?

591


class type to basic type conversion

1833


What are main features of oop?

627


What is persistence in oop?

665


What is advantage of inheritance?

685


Get me an image implementation program.

1557