类Aclass A{public:A(int x){y=x;}int y;}类Bclass B{public :B():A(10){}A q;}为什么会报错? A与B没有继承关系!!! 对的该怎么写?
没有继承关系不能这么写可以写class B{public :B(){q = new A(10);}A* q;}