You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Base {};
class Derived : public Base {};
void f(Base *);
int main() {
Derived d;
Derived *ptrd{&d};
Base *b{&d}; // 从 Derived* 类型隐式转换到 Base* 类型
b = ptrd; // 同上
f(ptrd); // 同上
}
类型转换回顾中C++应该是强类型语言

The text was updated successfully, but these errors were encountered: