Non mumber function can be delcared multiple times while member function can only be declared once? Is this right ? My example seems saying yes.
But Why ?
class Base{
public:
int foo(int i);
//int foo(int i=10); //error C2535: 'void Base::foo(int)' : member function already defined or declared
};
//but it seems ok to declare it multiple times
int foo(int i);
int foo(int i=10);
int foo(int i)
{
return i;
}
int main (void)
{
int i = foo();//i is 10
}