| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 368 人关注过本帖
标题:求助
取消只看楼主 加入收藏
wangweiliang
Rank: 1
来 自:湖北
等 级:新手上路
帖 子:6
专家分:0
注 册:2008-9-20
收藏
 问题点数:0 回复次数:0 
求助
请教高手,该程序如何改正.编绎时出现如下错误
F:\C++程序设计\summer programming\未完成\point\point.cpp(15) : fatal error C1001: INTERNAL COMPILER ERROR
        (compiler file 'msc1.cpp', line 1786)
         Please choose the Technical Support command on the Visual C++
         Help menu, or open the Technical Support help file for more information
执行 cl.exe 时出错.

point.exe - 1 error(s), 0 warning(s)

#include<iostream>
using namespace std;
class Point
{
public:
    Point()
    {
    }
    Point(double a,double b)
    {
        x=a;
        y=b;
    }
    friend Point operator +(Point &p1,Point &p2)
    {
        Point temp;
        temp.x=p1.x+p2.x;
        temp.y=p1.y+p2.y;
        return temp;
    }
    friend Point operator -(Point &p1,Point &p2)
    {
        Point temp;
        temp.x=p1.x-p2.x;
        temp.y=p1.y-p2.y;
        return temp;
    }
    bool operator ==(Point &s)
    {
        if(x=s.x&&y=s.y)
            return true;
        else
            return false;
    }
    bool operator !=(Point &s2)
    {
        if(x=s2.x&&y=s2.y)
            return false;
        else
            return true;
    }

    void display()
    {
        cout<<"("<<x<<","<<y<<")"<<endl;
    }
private:
    double x;
    double y;
};
void main()
{
    Point s1(2.1,3.3),s2(3.2,4.4),s3(2.2,3.5),s4(5.9,7.3);
    Point s,p;
    s=s1+s2;
    s.display();
    p=s1-s2;
    p.display();
    cout<<(s1==s3)<<endl;
    cout<<(s1!=s4)<<endl;
}
2008-09-21 14:24
快速回复:求助
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.028923 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved