R
Rahul
Hi Everyone,
The following code works fine,
class A
{
private: friend void sample(A& obj)
{
printf("in friend...\n");
printf("%d",obj.i);
}
public: A()
{
this->i = 5;
}
private: int i;
};
int main()
{
A obj;
sample(obj);
return(0);
}
I'm wondering what could be the significance of the private access
specifier to the friend function, what difference does it make?
Thanks in advance!!!
The following code works fine,
class A
{
private: friend void sample(A& obj)
{
printf("in friend...\n");
printf("%d",obj.i);
}
public: A()
{
this->i = 5;
}
private: int i;
};
int main()
{
A obj;
sample(obj);
return(0);
}
I'm wondering what could be the significance of the private access
specifier to the friend function, what difference does it make?
Thanks in advance!!!