#include
using namespace std;
struct Base1{int x;};
struct Base2{float y;};
struct Derived:Base1,Base2{};
int main(){
Derived *pd=new Derived;
pd->x=1;pd->y=2.0f;
//void *pv=pd; //没必要转成void*啊
//Base2 *pb=static_cast(pd); //没必要cast啊
Base2 *pb=pd;
cout<y<<" "< y< delete pd; //删除pd:因为创建的是Derived对象而且不是虚析构
return 0;
}