| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1039 人关注过本帖
标题:c++提示错误:'plural' followed by 'int' is illegal (did you forget a ' ...
取消只看楼主 加入收藏
anglebaby
Rank: 1
等 级:新手上路
帖 子:5
专家分:2
注 册:2013-9-30
结帖率:33.33%
收藏
已结贴  问题点数:10 回复次数:0 
c++提示错误:'plural' followed by 'int' is illegal (did you forget a ';'?)
#include<iostream>
using namespace std;
#include "function.h"

int main()
{
    plural f(4.5);   
    plural x(2.1,3.2);
    float a=2.3;
    f.add(x);
    f.printf();
    f.add(a);
    f.printf();
    f.subtract(x);
    f.printf();
    f.multiply(x);
    f.printf();
    return 0;
}
plural 是复数类
提示的错误:
function.cpp
C:\Users\qq\Desktop\function.cpp(5) : error C2628: 'plural' followed by 'int' is illegal (did you forget a ';'?)
C:\Users\qq\Desktop\function.cpp(8) : warning C4305: 'argument' : truncation from 'const double' to 'const float'
C:\Users\qq\Desktop\function.cpp(8) : warning C4305: 'argument' : truncation from 'const double' to 'const float'
C:\Users\qq\Desktop\function.cpp(9) : warning C4305: 'initializing' : truncation from 'const double' to 'float'
执行 cl.exe 时出错.
搜索更多相关主题的帖子: Desktop include return Users 
2013-11-02 10:24
快速回复:c++提示错误:'plural' followed by 'int' is illegal (did you forge ...
数据加载中...
 
   



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

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