C++ 关于类的复合的问题拜托各位了 3Q
答案:2 悬赏:40
解决时间 2021-02-19 12:02
- 提问者网友:孤笛钟情你
- 2021-02-18 20:58
#include #include using namespace std; class zuobiao { private: int x,y; public: zuobiao(int a,int b) { x=a;y=b; } }; class point { private: zuobiao d,e,f; public: point() { d(12,22); e(22,1); f(12,12); } }; 不知道错误在哪里,刚学的 类的这一张!还请各位多多指教了!
最佳答案
- 二级知识专家网友:啵啵桃汀
- 2021-02-18 21:30
class point { private: zuobiao d,e,f; public: point(): d(12,22), e(22,1), f(12,12) { } }; 采用这种形式来初始化,你的写法通不过是因为class zuobiao没有默认构造函数
全部回答
- 1楼网友:两不相欠
- 2021-02-18 22:52
支持一下感觉挺不错的
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯