class Top
{
public:
void f (int i) {cout<<endl<<i;};
void f (double d) {cout<<endl<<d;};
};
class Left :publicvirtual Top
{
};
class Right :publicvirtual Top
{
public:
void f(int i)
{cout<<"Right::f"<<endl;};
};
class Bottom :public Left,public Right
{
};
void main (void)
{
Bottom b;
b.f(123.123);
//b.Top::f(123.123);
cout<<"\npress<ENTER> to terminate";
cout.flush();
getchar();
}
the programm prints Right::f
why doesnt it print 123.23??
why doesnt it choose the f with double parameter???