+ 5

Can any one explain

What is the problem in this program https://code.sololearn.com/ci8lyVidN3lh/?ref=app

30th Aug 2019, 6:08 PM
👀 Sandy👀
👀  Sandy👀 - avatar
4 Respuestas
+ 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; }
30th Aug 2019, 6:40 PM
HonFu
HonFu - avatar
30th Aug 2019, 6:52 PM
Paolo De Nictolis
Paolo De Nictolis - avatar