point.cpp
来自「vc++教程代码,完整的vc++代码,学习必备,大家共享,有问题请联系我」· C++ 代码 · 共 45 行
CPP
45 行
#include <iostream.h>
class Point
{
public:
int x;
int y;
/* void init()
{
x=0;
y=0;
}*/
Point()
{
x=0;
y=0;
}
Point(int a,int b)
{
x=a;
y=b;
}
~Point()
{
}
void output()
{
cout<<x<<endl<<y<<endl;
}
void output(int x,int y)
{
this->x=x;
this->y=y;
}
};
void main()
{
Point pt(3,3);
pt.output(5,5);
// pt.init();
//pt.x=5;
//pt.y=5;
// cout<<pt.x<<endl<<pt.y<<endl;
pt.output();
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?