What is friend function?

Answer Posted / lakshmi.t

If a class B is derived from A, we can access the data and
member function of A.So in order to access a class data or
function from another class we have to derive the class.
but this can be done by declaring a class as 'friend' and
can access the another class functions and data.

Is This Answer Correct ?    26 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How is class defined?

585


What is the diamond problem in inheritance?

577


What does sksksk mean in text slang?

1534


What are the two different types of polymorphism?

672


Can we create object of interface?

601






What is the important feature of inheritance?

632


write a program that takes input in digits and display the result in words from 1 to 1000

1987


Please send ford technologies placement paper 2 my mail id

1654


Write a c++ program to display pass and fail for three student using static member function

2814


Why is polymorphism needed?

598


write a C++ program for booking using constructor and destructor.

2049


What is encapsulation with real life example?

570


What are the three main types of variables?

600


What is the difference between a mixin and inheritance?

522


Explain virtual inheritance?

682