类型转换运算符

· dynamic_cast:允许对象类型向上转换,即允许派生类向基类转换,但不允许基类向派生类转换,否则返回空指针
· const_cast:用于消除const限制
· static_cast:同类型转换,允许向上或向下转换,可以将枚举项和整形互相转换
· reinterpret_cast:略

猜你喜欢

转载自www.cnblogs.com/chendeqiang/p/11483411.html