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
What is the full form of oops?
What is abstract class in oop?
What is advantage of inheritance?
String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?
What are functions in oop?
What is difference between oop and pop?
How do you answer polymorphism?
What is destructor oops?
What is interface in oop?
What is polymorphism oop?
What do you mean by Encapsulation?
What is the real time example of encapsulation?
Give two or more real cenario of virtual function and vertual object
what type of question are asked in thoughtworks pair programming round ?
INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?