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

Why is there no multiple inheritance?

763


What type of loop is a for loop?

856


Why multiple inheritance is not possible?

791


Where You Can Use Interface in your Project

1611


write a programe to calculate the simple intrest and compund intrest using by function overlading

1888


Can we create object of interface?

827


Why do we use oop?

817


Is data hiding and abstraction same?

761


What is polymorphism what is it for and how is it used?

762


What is the use of oops?

792


What are the types of abstraction?

766


Why do we need oop?

863


What are objects in oop?

822


What is persistence in oop?

852


What is multilevel inheritance explain with example?

861