What is the difference between defining friend function inside the class or declaring inside and define outside of the class. Also why it is possible to place definition ins
It is not proper to define a friend function inside a class.
We use friend function to grant access to private members of the class to a function.
If we define friend function inside class then in a way it becomes a data member of the class and we know that data member of the own class has access to its private members.
So if you really want to make use of the friend concept in C++ then declare it outside of the private class.