c++中class和struct的构造函数方式相同: struct { int x; int y;; int val; Node():x(0),y(0),z(0){}; Node(int i,int j,int k):x(i),y(j),val(k){}//有参构造函数} 赞微海报分享
近期评论