Friend function | Sololearn: Learn to code for FREE!

0

Friend function

Hi , can anyone explain how to define friend function when separating files for classes? In my header file I have friend f() inside the class and in cpp file I have a mistake “invalid specifier outside a class declaration “ Thanks

12/18/2018 2:50:06 PM

Nazar

1 Answer

New Answer

+3

It helps to put your code into the playground and link it to your post so we can see your issue. Without that there are so many possibilities that I don't know where to begin.