标题:编译错误!
取消只看楼主
lockhawk
Rank: 1
等 级:新手上路
帖 子:94
专家分:0
注 册:2008-9-17
 问题点数:0 回复次数:1 
编译错误!
#include "iostream.h"
#include "stdlib.h"
#include "math.h"
void star(int a);
int main()
{
    int n;
    cout<<"请输入星号的个数:";
    cin>>n;
    cout<<star(n)<<endl;
    return 0;
}
void star(int a)
{
    
    for(int i=0;i<a;i++)
    {
        cout<<'*';
    }
}


error C2679: binary '<<' :no operator defined which takes a right-hand operand of type 'void' (or there is no acceptable conversion)

#include "stdlib.h"不是已经调用void了?
搜索更多相关主题的帖子: 编译 
2008-09-23 18:56
lockhawk
Rank: 1
等 级:新手上路
帖 子:94
专家分:0
注 册:2008-9-17
得分:0 
怪我~看书不仔细~
2008-09-23 19:14



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




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

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