请问一个程序在VC6.0上可以运行,但在visual studio2010上就不能运行这是为什么????
以下程序vc6.0正常运行,在visual studio2010上说重载有问题,请指正!!!!#include <iostream>
#include <cmath>
using namespace std;
class Point
{
public:
Point(){x=0;y=0;}
Point(int X,int Y);
int GetX(){return this->x;}
int GetY(){return this->y;}
double Distance() ;
private:
int x,y;
};
Point::Point(int X,int Y){x=X;y=Y;}
double Point::Distance() {double dis; dis=sqrt(x*x+y*y); return dis;}
void main()
{
Point p0;
cout<<p0.GetX()<<","<<p0.GetY()<<endl;
cout<<p0.Distance()<<endl;
int m,n;
cin>>m>>n;
Point p1(m,n);
cout<<p1.GetX()<<","<<p1.GetY()<<endl;
cout<<p1.Distance()<<endl;
}
搜索更多相关主题的帖子: return