E
Ernst Murnleitner
Dear C++ programmers,
I have 2 classes
A and B
with virtual functions
virtual long A::Save();
virtual long B::Save(bool b = true);
Now, if I have a Pointer A * which points to a B Object:
B b;
A * p = & b;
p->Save();
Unfortunately A::Save() is called but I wanted B::Save() to be called.
In this case, the default parameter of B::Save() is senseless - but the
compiler gives no error.
???
Greetings
Ernst
I have 2 classes
A and B
with virtual functions
virtual long A::Save();
virtual long B::Save(bool b = true);
Now, if I have a Pointer A * which points to a B Object:
B b;
A * p = & b;
p->Save();
Unfortunately A::Save() is called but I wanted B::Save() to be called.
In this case, the default parameter of B::Save() is senseless - but the
compiler gives no error.
???
Greetings
Ernst