有如下代码: struct A1{ virtual ~A1(){}...
发布于 2022-03-02 17:01:32
有如下代码:
struct A1 { virtual ~A1() {} } struct A2 { virtual ~A2() {} } struct B1 : A1, A2 {} int main() { B1 d A1* pb1 = &d A2* pb2 = dynamic_cast<A2*>(pb1) //L1 A2* pb22 = static_cast<A2*>(pb1) //L2 return 0 }
登录后免费查看答案
关注者
0
被浏览
23