9. class B {};
class D : public B {};
void f(B* pb, D* pd)
{
D* pd2 =
static_cast<D*>(pb);
B* pb2 =
static_cast<B*>(pd);
}
10. class B {};
class D : public B {};
void f(B* pb, D* pd)
{
D* pd2 =
static_cast<D*>(pb);
B* pb2 =
static_cast<B*>(pd);
}
class B { };
class C : public B { };
class D : public C { };
void f(D* pd) {
C* pc =
dynamic_cast<C*>(pd);
B* pb =
dynamic_cast<B*>(pd);
}
11. class B {};
class D : public B {};
void f(B* pb, D* pd)
{
D* pd2 =
static_cast<D*>(pb);
B* pb2 =
static_cast<B*>(pd);
}
class B { };
class C : public B { };
class D : public C { };
void f(D* pd) {
C* pc =
dynamic_cast<C*>(pd);
B* pb =
dynamic_cast<B*>(pd);
}
const int value = 100;
int i = const_cast<int>
(value);