Friend functions are declared outside the class body. They have access to all private and protected members of the class.
Output:
Explanation:
line 13
a function is marked as "friend". It has no body inside the class.lines 23 - 26
the friend function is declared. The body of a
friend function is declared outside the class.line 32
the friend function is called.