您好,登錄后才能下訂單哦!
將做工程過程中常用的內(nèi)容片段記錄起來,如下內(nèi)容內(nèi)容是關(guān)于C語言基礎(chǔ):數(shù)組作為函數(shù)參數(shù)傳遞演示的內(nèi)容,應(yīng)該能對(duì)小伙伴也有好處。
#include <stdio.h>
void show_array(int values[], int number_of_elements)
{
int i;
printf("About to display %d valuesn", number_of_elements);
for (i = 0; i < number_of_elements; i++)
printf("%dn", values[i]);
}
int main(void)
{
int scores[5] = {70, 80, 90, 100, 90};
int count[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int small[2] = {-33, -44};
show_array(scores, 5);
show_array(count, 10);
show_array(small, 2);
return 1;
}
輸出結(jié)果
About to display 5 values
70
80
90
100
90
About to display 10 values
1
2
3
4
5
6
7
8
9
10
About to display 2 values
-33
-44
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。