M
mosfet
Hi,
Let's say I have two classes A and B with B inheriting from A
with one non virtual method :
class A
{
public:
void MethodA()
{
cout << "MethodeA in class A" << endl
}
};
class B : public class A
{
public:
void MethodA()
{
cout << "MethodeA in class B" << endl
}
};
int main()
{
B testB;
testB.MethodA(); // Should display "MethodeA in class B"
}
IF I try this example the MethodA from class B will be called.
And what if I want from a B object to call the A implementation ? Is it
possible ?
Let's say I have two classes A and B with B inheriting from A
with one non virtual method :
class A
{
public:
void MethodA()
{
cout << "MethodeA in class A" << endl
}
};
class B : public class A
{
public:
void MethodA()
{
cout << "MethodeA in class B" << endl
}
};
int main()
{
B testB;
testB.MethodA(); // Should display "MethodeA in class B"
}
IF I try this example the MethodA from class B will be called.
And what if I want from a B object to call the A implementation ? Is it
possible ?