关于C++,如果把a(x1,y1);b(x2,y2);c(x3,y3)写在花括号里就是错误,但如果写成参数化表就不错,why?

发布于2022-01-13 06:49:57

public:p(double x1,double y1){x=x1;y=y1,double y3):p(x,y){a(x1,y1);b(x2:double x;double y,double x3;a# includeusing namespace std;c(x3,y3);};};int main(){v a(15,16:public p{protected:p a;p b;p c;public,double x2.display();class p{protected,45);x<}};<,1,double x1,double y2,19,19;class v,y2),double y1:void display(){a.display();b.display();c.display();}v(double x,double y;}void display(){cout<;

2个回答
admin
网友回答2022-01-13
这是C++初始化成员的方法。表示在v的构造函数第一条语句前,执行成员构造函数。
admin
网友回答2022-01-13

回到
顶部