class Bus: public Vehicle
{
public:
void ShowStation();
}
Vehicle *pVehicle =new Vehicle();
Bus bus ;
pVehicle = &bus;
dynamic_cast<Bus *>(pVehicle)->ShowStation()
上面的dynamic_cast在運行時有錯,why?
{
public:
void ShowStation();
}
Vehicle *pVehicle =new Vehicle();
Bus bus ;
pVehicle = &bus;
dynamic_cast<Bus *>(pVehicle)->ShowStation()
上面的dynamic_cast在運行時有錯,why?