so here's a simplified version of my setup:
class GenericSensor{
public:
int read(){
return something;
}
};
class SpecialSensor : public GenericSensor{
public:
int read(){
return somethingElse;
}
};
and I have a function:
void someFunction(GenericSensor s){
printf("value is: %d\n", s.read());
}
how do I make someFunction
work with GenericSensor
, SpecialSensor
or any other derived class's object?