从基类到派生类的自动转换是不存在的。
There is no automatic conversion from the base class to a derived class.
当具有基类的引用或指针,但需要执行不是基类组成部分的派生类操作的时候,需要动态的强制类型转换。
Dynamic casts are needed when we have a reference or pointer to a base class but need to perform operations from the derived class that are not part of the base class.
当具有基类的引用或指针,但需要执行不是基类组成部分的派生类操作的时候,需要动态的强制类型转换。
Dynamic casts are needed when we have a reference or pointer to a base class but need to perform operations from the derived class that are not part of the base class.
应用推荐