摘要: 閱讀全文
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?
僅列出標(biāo)題
共2頁: 1 2