For Loop over Collection

#include <iostream>
#include <vector>

int main() {
    vector<std::string> fruits = {"apple", "banana", "mango"};
    
    for(auto const& el: fruits) {
        std::cout << el << std::endl;
    }
}
apple
banana
ma


Reference