// This program will just demonstrate a very simple array // being: // 1. declared // 2. initialised // 3. accessed // Week 3 Lecture 2 - The beginning of arrays #include int main(void) { // 1. Declare an array // if it is an array of ints, and there are 8 numbers, the indexes 0 -> 7: int array_int[4] = {0}; //int array_int[] = {1, 2, 3}; //int array_int[]; // NOT THIS! // 2. Initialise an array = note that you can't initialise the whole array after // declaration, but can do it all at once. // 3. Access an array array_int[2] = 3; // 0, 0, 3, 0 return 0; }