Array
Index
#include <stdio.h>
int main() {
int const index = 0;
int numbers[5] = { 1, 2, 3, 4, 5 };
printf("numbers[%d] = %d\n", index, numbers[index]);
numbers[index] = numbers[index - 1] * 2;
printf("numbers[%d] = %d\n", index, numbers[index]);
return 0;
}
代码2-4:数组基础
程序运行结果