Hi All,
in below class i wanted to have two friend function(overloading) one with default argument and other is without default argument.
but during compilation it gives error. could you let me know how to fix (overload) this by not changing the function name , argument type or number of arguments.
error:
warning: void fun(int, int, int) is already a friend of class foo
#include<iostream>
using namespace std;
class foo
{
public:
friend void fun (int a, int b, int c);
friend void fun (int a, int b, int c=20);
};
int main()
{
return 1;
}