Jump to content

Friend function

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Raviemani (talk | contribs) at 11:01, 2 May 2007 (Created page with 'Friend Function in Object-Oriented Programming acts as a friend to a class. It is a non-member function of a class. It is declared as a friend using the keyword 'fr...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Friend Function in Object-Oriented Programming acts as a friend to a class. It is a non-member function of a class. It is declared as a friend using the keyword 'friend' inside the class. By declaring so, all the access permissions are given to the function. This implies, a friend function can access all public, private and protected data of a class.