C/C++ Arena

Step 4 of 6

bool, auto and range-for

A few small upgrades:

std::string s = "awp";
for (char c : s) {
    std::cout << c << "\n";
}

Your turn: write int count_vowels(std::string s) that counts a e i o u (lowercase only) using a range-based for loop.

Previous: std::string is easy Next: Namespaces and using