What is a friend function & its advantage?
Answers were Sorted based on User's Feedback
Answer / supriya
friend function is the one that can access the private data
members of the class to which it is made as friend. this is
advantageous when any class needs any computation which
requires the private data members of two different classes.
in such case that class can be made as friend to both the
classes whose data it needs
| Is This Answer Correct ? | 27 Yes | 4 No |
Answer / devi
The above ans is also right.
->Friend function is the one that can access the private
data members of the same class and other class which it is
made as friend.
->The advantageous of friend function that function not called
by object of the class.
->That means without using object name and dot operator that call the friend function.It
can define private area and public area.
->The friend function define outside the class without using
the class name and scope resolution operator.
| Is This Answer Correct ? | 16 Yes | 7 No |
can you give the dynamic polymorphism types?
What is the purpose of polymorphism?
Explain the advantages of inheritance.
What is class and object in oops?
What is abstraction and encapsulation?
what do you mean by static member variable?
What is encapsulation with real life example?
What is difference between new and malloc?
What is Hashing and how is it done? Pictorial form?
what is the difference between <stdio.h>and "stdio.h"?
What is the highest level of cohesion?
What is the difference between abstraction and polymorphism?