|
|
#include <iostream.h>
typedef int array[8];
int a[8] = {1, 3, 5, 7, 9, 11, 13};
void fun(array &b, int n)
{
for(int i=0; i<n-1; i++)
b[7]+=b;
}
void main()
{
int m=8;
fun(a, m);
cout<<a[7]<<endl;
}
我有几点不明白:
1、typedef将int定义为一个数组是什么意思?
2、a[8]为什么只有7个元素?
3、fun函数用array定义&b是什么意思?
4、b[7]是what?
本人比较弱,请别笑话! |
|