title: Friend functions in C++
body: <p>I have a doubt related to friend functions in C++. Friend function is not a member function of the claas and can be invoked directly from the main. So, what difference does it make if we keep the <code>friend</code> function within the <code>private</code> or the <code>public</code> part of the <code>class</code>. I have generally noticed that the <code>friend</code> functions are always in the public part. In what scenario we should keep the <code>friend</code> function within <code>private</code>.</p>