By: 貝絲
索引值index
箱子 = 元素element
整排的箱子 = 陣列
索引值從0開始
共有5個元素
陣列名稱 =test
int test[5]; //宣告陣列
test[0] = 80;
test[1] = 60;
test[2] = 22;
test[3] = 50;
test[4] = 75;
int test[5] = {80, 60, 50, 22, 75};
float temp[8] = {25.4, 18.9, 27.3, 15.6, 30.0, 12.5, 22.3};
char name[8] = {'J', 'a', 's', 'm', 'i', 'n', 'e', '\0'};
// 字串的末尾要有空字元
int test[6] = {0,0,0,0,0,0};
// 0,0,0,0,0,0
int test[6] = {};
// 0,0,0,0,0,0
int test[6] = {0};
// 0,0,0,0,0,0
int test[6] = {1};
// 1,0,0,0,0,0