标题: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



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-422928-1-1.html




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

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