D
David Chandler
Let me try to describe the situation as clearly as I can.
In namespace XXX I have a class PARENT with the following public
functions:
virtual void foo( const char* stringBuf ); // set function for foo
virtual char* foo() const; // get function for foo
both of these functions have implementations in the PARENT.cpp file.
In namespace YYY I have a class CHILD
class CHILD: public XXX:ARENT
{
void foo( const char* stringBuff); // overrides parent's SET foo
// note that parent's GET foo is NOT overridden
}
CHILD.cpp has it's own foo implementation.
Along comes some class USER that uses CHILD.
YYY::CHILD* childPtr;
// some stuff that sets childPtr
someOtherString = childPtr->foo(); // should call the parent's GET
This line dies in the compiler.
"No matching function call to 'YYY::CHILD::foo() const'
Candidates are: 'void YYY::CHILD::foo(const char *)'
Any idea why this fails to find the parent's inherited foo function?
By the way, there ARE other child classes, lets call them CHILD2 that
do NOT override either of the parent's foo functions. These classes
are used without difficulty.
Thanks for your help
Dave
In namespace XXX I have a class PARENT with the following public
functions:
virtual void foo( const char* stringBuf ); // set function for foo
virtual char* foo() const; // get function for foo
both of these functions have implementations in the PARENT.cpp file.
In namespace YYY I have a class CHILD
class CHILD: public XXX:ARENT
{
void foo( const char* stringBuff); // overrides parent's SET foo
// note that parent's GET foo is NOT overridden
}
CHILD.cpp has it's own foo implementation.
Along comes some class USER that uses CHILD.
YYY::CHILD* childPtr;
// some stuff that sets childPtr
someOtherString = childPtr->foo(); // should call the parent's GET
This line dies in the compiler.
"No matching function call to 'YYY::CHILD::foo() const'
Candidates are: 'void YYY::CHILD::foo(const char *)'
Any idea why this fails to find the parent's inherited foo function?
By the way, there ARE other child classes, lets call them CHILD2 that
do NOT override either of the parent's foo functions. These classes
are used without difficulty.
Thanks for your help
Dave