| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 613 人关注过本帖
标题:这里函数调用为左值为什么是错的
取消只看楼主 加入收藏
芦苇太帅了
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2013-8-16
结帖率:75%
收藏
 问题点数:0 回复次数:1 
这里函数调用为左值为什么是错的
#include<iostream.h>

int array[6][4]={ {60,80,90,75},
{75,85,65,77},
{80,88,90,98},
{89,100,78,81},
{62,68,69,75},
{85,85,77,91} };

int getLevel(int grade(int grade[],int size));

int main()
{
    int typeA=0,typeB=0;
    int student=6;
    int gradesize=4;

    for(int i=0;i<student;i++)
        if(getLevel(array[i],gradesize))
        {   
            typeA++;
        }
        else
        {
            typeB++;
        }

        cout<<"number of type A is "<<typeA<<endl;
        cout<<"number of type B is "<<typeB<<endl;
        return 0;
}

int getLevel(int grade[],int size)
{
    int sum=0;
    for(int i=0;i<size;i++)
        sum+=grade[i];

    sum/=size;
    if(sum>=80)
        return 1;
    else
        return 0;
}
--------------------Configuration: pp196 - Win32 Debug--------------------
Compiling...
pp196.cpp
f:\c++文件\p196\pp196.cpp(19) : error C2660: 'getLevel' : function does not take 2 parameters
执行 cl.exe 时出错.

pp196.obj - 1 error(s), 0 warning(s)
搜索更多相关主题的帖子: include number 
2013-08-30 19:05
芦苇太帅了
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2013-8-16
收藏
得分:0 
大婶,谢了!!!!!!!!!
2013-08-31 11:39
快速回复:这里函数调用为左值为什么是错的
数据加载中...
 
   



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

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