请大神指点!输出有误........
#include<iostream>using namespace std;
class s
{
private:
int x,y,z;
public:
s(int x,int y,int z);
int getx();
};
s::s(int x,int y,int z)
{
x=x;
y=y;
z=z;
}
int s::getx()
{
return x;
}
int main()
{
s p1(2,0,0);
cout<<p1.getx();
return 0;
}
为什么输不出结果呀?哪里错了?请大神详解呀??????