1234567891011//强制转换类型static_cast<>();reinterpret_cast<>();//cast关键字const int ease = 81;const char str[20] ="dsjaid";cahr * ps = const_cast<char *>(str); //ps指针就可以修改str的值 父类指针转换为子类对象123456789101112131415void show(Animal *base){ base->cry(); Cat* pc = dynamic_cast<Dog *>(base); if(pc) { pc->catchMouse(); } Dog* pd = dynamic_cast<Cat *>(bash); if(pd) { pd->seeHome(); }}