A good thing for loops is a quick access method. Therefore, if you want to do all the elements in an array, you can simply do the following:
(double number: arrayName) where double is the type, number is the name that you give each element (no matter what you call it, in this case you will refer to each value there as a "number"). And arrayName is the name of the array you are accessing.
If you want to reach each element / object, this is the fastest way.
Tal c source share