65,210
社区成员
发帖
与我相关
我的任务
分享
//LZ这样并没有错啊,我VS2008可以运行的。
#include <iostream>
using namespace std;
class point
{
public:
point(int xx,int yy);
int getx()
{return x;}
int gety()
{return y;}
private:
int x,y;
};
point::point(int xx=7,int yy=8)
{
x=xx;
y=yy;
}
void main()
{
point A;
point B(1);
point C(2,3);
cout <<A.getx() <<"," <<A.gety() <<endl;
}
#include <iostream>
using namespace std;
class point
{
public:
point(int xx=7,int yy=8);
int getx()
{return x;}
int gety()
{return y;}
private:
int x,y;
};
point::point(int xx,int yy)
{
x=xx;
y=yy;
}
void main()
{
point A;
cout <<A.getx() <<"," <<A.gety() <<endl;
}