求解释行C++
程序代码:
#include <iostream> #include <iomanip> using namespace std; class Point { public: Point(double aa=0,double bb=0) { x=aa; y=bb; } void show() { cout<<"Point : ("<<setprecision(16)<<x<<", "<<y<<")\n"; } private: double x,y; }; int main() { char c; double a, b; Point q; while(std::cin>>a>>c>>b) { Point p(a, b); p.show(); } q.show(); }
while里那个Point p(a,b)怎么理解?
我感觉应该写成
Point p; Point.Point (a,b);