函数为p1.setx(double x)报错提示为: C++ 没有与这些操作数匹配的 运算符 ”>>“ 操作数类型为: std::istream >> void
我并不想再找个double值来存放读入的数据,而是想用cin直接键入函数参数
先定义个double x;cin>>x;p1.setx(x);
iostream中有cin;stdio中有scanf;double x;scanf("%lf",&x);p1.setx(x);