Professional Documents
Culture Documents
Friend Func
Friend Func
and
Friend Classes
Friend function
Function
friend.
The function definition does not use either
the keyword friend or the scope resolution
operator ::.
Friend function
It
Eg
#include<iostream.h>
Class ABC;
Class XYZ
{ int x;
public :
void setvalue(int i) { x=i;}
friend void max(XYZ, ABC);
};
Class ABC
{ int a;
public :
void setvalue(int i) { a=i;}
friend void max(XYZ, ABC);
};
Friend Classes
The