What is an array?
An array is a collection of variables (called elements) which can be accessed by the array name and the elements subscript (index)
Which index would you use to access the 2nd variable in an array?
arrayname[1]
What can you say about the size of an array?
It has to be stated as a constant at compilation time if it is a fixed array. Trying to access an out of bounds index will produce unforeseen results.
How can you initialize an array?
Individual elements can be initialized eg myArray[4] = 23;
Or they can be initialized on mass by using an initializer list eg int myArray[5] = { 12, 5, 56, 0, 23};
How can you get the size of an array in bytes?
Use the sizeof(anArray) function but not on an array passed into a function this just gives the size of the pointer to the array.
How can you use the function sizeof in order to calculate the number of elements in an array?
You divide the total size of the array by one single element eg sizeof(anArray) / sizeof(anArray[0]) = number of elements in array.
What happens when you try to write outside the bounds of the array?
You will get undefined behavior - which is usually very bad