WHAT IS FRIEND FUNCTION IN C ?

Ankita Pandey

Total Post:183

Points:1285
Posted by  Ankita Pandey
 1136  View(s)
Ratings:
Rate this:
Hi,

What is friend function in c++?

Thanks in advance. 
  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: What is friend function in c ?

    A friend is not a member of a class but still has access to its private elements.Two reasons that friend functions are useful have to do with operator overloading and the creation of certain types of IO functions.A friend function is defined as a regular ,nonmember function. However,inside the class declaration for which it will be a friend,its prototype is also included,prefaced by the keyword friend.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!