04-07-2006, 07:52 PM
Code:
#include "Wrapper.h"
int Compare(int, int);
int main(){
//stuff
}
int Compare(int x, int y){
if (x == y)
return 0
else
return 1
}
Wrapper inherites from object where Compare is declared as pure virtual. In Wrapper.cpp I have an error here:
Code:
template <class datatype>
int Wrapper<datatype>::CompareTo (Object const & obj) const { Wrapper<datatype> const & arg = dynamic_cast<Wrapper<datatype> const &> (obj);
// comparing wrapped datatype, not objects, so need to cast
return :: Compare (datum, arg.datum);
// :: Compare(...) is global and define in the driver program
}
The error is on the return command saying that Compare has not been declared. What's going on?