Home > DeveloperSection > Forums > What is friend function in c ?
Ankita Pandey
Ankita Pandey

Total Post:183

Points:1285
Posted on    June-14-2013 11:55 PM

 Visual C++ Visual C++ 
Ratings:


 1 Reply(s)
 757  View(s)
Rate this:
Hi,

What is friend function in c++?

Thanks in advance. 


AVADHESH PATEL

Total Post:604

Points:4228
Posted on    June-15-2013 4:42 AM

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.


Don't want to miss updates? Please click the below button!

Follow MindStick