Friend functions are declared inside a class but defined outside. They're not affected by public/private/protected sections - placement makes no difference to meaning. They're not member functions, so they need object references to access members, and can be called independently.