+ 5
Can any one explain
What is the problem in this program https://code.sololearn.com/ci8lyVidN3lh/?ref=app
4 odpowiedzi
+ 6
The friend function has to be a free function, you have to define it outside.
So you have to erase that B:: and it works.
void fun(A a,B b)
{
a.s=10;
cout<<"the s value is "<<a.s;
}