Computer Science, asked by sengkanhanse, 6 months ago

write a program to explain the concept of friend function?also explain the use of friend function.

Answers

Answered by mahek6827
0

Answer:

In object-oriented programming, a friend function, that is a "friend" of a given class, is a function that is given the same access as methods to private and protected data. A friend function is declared by the class that is granting access, so friend functions are part of the class interface, like methods.

A C++ friend functions are special functions which can access the private members of a class. They are considered to be a loophole in the Object Oriented Programming concepts, but logical use of them can make them useful in certain cases.

Explanation:

hi dear....hope this helps u ...

Similar questions