#include <iostream.h>
class Point
{
public:
int x;
int y;
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)
{
x=x;
y=y;
}
};
void main()
{
Point pt(3,3);
pt.output(5,5);
pt.output();
}
上面是一段VC++的程序,正确的输出是什么,为什么? |