class A
{ public:
void g(int i)
{ cout<<"in a";
}
};
class B:public A
{ public:
void f()
{ cout<<"in b";
}
};
int main()
{ B b;
b.f(); //vl call b::f()
b.g(4); //vl call a::g()
}
but
class A
{ public:
void f(int i)
{ cout<<"in a";
}
};
class B:public A
{ public:
void f()
{ cout<<"in b";
}
};
int main()
{ B b;
b.f(); //vl call b::f()
b.f(4); //bt here errror occurs not a matching protoype...
}
my ques is that cant we overload function in inheritance(which vary in
parameters)..???
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.