I'm so confused, why I can't access void func(int i)
, anybody can help me?
Of course this is just a demo to help your understand my question easily. Its real code is huge, I want the member functions in Base and Child both available.
The output always is **
double
2
**
struct base
{
void func(int i)
{
cout << "int" << endl;
cout << i << endl;
}
};
struct child : base
{
void func(double d)
{
cout << "double" << endl;
cout << d << endl;
}
};
child c;
c.func((int)2);