标题:请帮帮忙
取消只看楼主
chenbiancheng
Rank: 1
等 级:新手上路
帖 子:19
专家分:0
注 册:2008-11-30
 问题点数:0 回复次数:1 
请帮帮忙
有这么个程序:
    #include<iostream>
    using namespace std;
    typedef double array[12];
    void avecount(array&b,int n)
  { double ave(0);
     int count(0);
    for(int j=0,i<n-2;j++)
      {ave=ave+b[j];
       if(b[j]<60)count++;
           }
       b[n-2]=ave/(n-2);
       b[n-1]=count;
    }
       void main()
      {array b=[12,34,56,78,90,98,76,85,64,43];
         array&a=b;
          avecount(a,12);
   count<<"平均成绩为"<<a[10]<<"分,而不及格人数有"<<int(a[11])<<"人。"<<endel;
    }  
  这个程序中引用部分和下面这个不太一样,
   typedef double array(10);
    void main()
{array a=[12,34,56,78,90,98,76,85,64,43];
    array&b=a;
     a[2]=100;
||||||||||||||||||||||
      我在书上看到引用的格式,是第二个程序那种类型。
     typedef int array[10]
   array a;
     array&b=a;
请大家帮忙解释一下——就是帮忙解释一下引用的具体格式及具体应用时的方式。
搜索更多相关主题的帖子: 拜托各位了 
2008-12-06 20:20
chenbiancheng
Rank: 1
等 级:新手上路
帖 子:19
专家分:0
注 册:2008-11-30
得分:0 
二楼的什么意思?
2008-12-08 19:38



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




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

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