C语言基础:数组作为函数参数调用代码演示
#include <stdio.h> void show_array(int values[], int number_of_elements) { int i; for (i = 0; i < number_of_elements; i++) printf("%d\n", values[i]); } int main(void) { int scores[5] = {70, 80, 90, 100, 90}; show_array(scores, 5); return 1; }
输出结果
70 80 90 100 90