Would you mind explain the "array of objects" for me?
Hello Daniel, thank you for the question.
An array is a way of ordering a group of variables of the same type. You used the term "objects" in your question, but those "objects" could be any variable type at all. You can even have an array of arrays. When you declare an array, you use . Inside the , you put a number. The number represents the number of objects you want to make an array of.
Would declare an array of 20 integers. If you need to access a certain element in the array, you can index it with the brackets and a number.
ary = 54;
This sets the 5th integer in the array to be 54. This brings us to another point, the first element in an array is always 0.
ary = 1;
Sets the first element in the array to be 1. An easy way to loop through all the items in an array would be like this:
const int size = 20;
for(int i = 0; i < size; i++)
ary[i] = i * 2;
That for loop is very commonly used for indexing arrays, as it starts on the first element and ends with the last by incrementing the i variable each iteration through the loop.
If you have any further questions, please don't hesitate to ask.
I hope this infomation was helpful.