目录
把数组传给函数(Passing Arrays to Functions)
向函数传递一维数组
向函数传递二维数组
数组在学生成绩管理中的应用
例:计算每个学生的平均分
把数组传给函数(Passing Arrays to Functions)

向函数传递一维数组
【例】计算平均分:
计数
控制—键盘输入学生人数


向函数传递二维数组

数组在学生成绩管理中的应用
保存
n
个学生一门课程的成绩
用一维数组
int
Average(
int score[], int n
);
通常不指定数组的长度,用另一个形参来指定数组的大小
保存
n
个学生的
m
门课程的成绩
用二维数组
void Average(
int score[][COURSE_N], float aver[], int n
);
可省略数组第一维的长度,不能省略第二维的长度
数组
aver
可保存每个学生的平均分,或每门课程的平均分
例:计算每个学生的平均分

