请教c++高手,帮忙改改,急用,在线等,谢谢了!
请教c++高手,帮忙改改,急用,在线等,谢谢了!
日期:2017-12-01 22:30:24 人气:1
#includeusing 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