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 |
What is byval and byref? What are differences between them?
What is the point of polymorphism?
In which Scenario you will go for Interface or Abstract Class?
1 Answers InfoAxon Technologies,
What are the advantages of inheritance?
26 Answers IBS, TCS,
What do you mean by inline function?
What is the concept of object oriented program?
The IT giant Tirnop has recently crossed a head count of 150000 and earnings of $7 billion. As one of the forerunners in the technology front, Tirnop continues to lead the way in products and services in India. At Tirnop, all programmers are equal in every respect. They receive identical salaries and also write code at the same rate. Suppose 14 such programmers take 14 minutes to write 14 lines of code in total. How long will in take 5 programmers to write 5 lines of code in total ?
What is virtual function?where and when is it used?
How can we use the preprocessor #if and #elseif.
what are three tenets of object orinted Systems?Why they call like that ? Please answer me. Advance thanks.
Why it is called runtime polymorphism?
how to find the correct email address format by using the programe?