Hi, i am trouble with this.. Is there some solution or i have to keep exactly class types?
//header file
Class Car {
public:
Car();
virtual ~Car();
};
class Bmw:Car {
public:
Bmw();
virtual ~Bmw();
};
void Start(Car& mycar) {};
//cpp file
Car::Car(){}
Car::~Car() {}
Bmw::Bmw()
:Car::Car(){}
Bmw::~Bmw() {}
int main() {
Car myCar;
Bmw myBmw;
Start(myCar); //works
Start(myBmw); //!! doesnt work
return 0;
}