C++ Arrays and Loops
Loop Through an Array You can loop through the array elements with the for loop. The following example outputs all elements in the cars array: Example // Create an array of strings string cars[5] = {“Volvo”, “BMW”, “Ford”, “Mazda”, “Tesla”};…