Solution Review 1: Let's Find the Total Number of Vowels
Explore how to count vowels in a string using recursion in C++. This lesson helps you understand the structure of a recursive function, including base and recursive cases, and how to process string characters effectively. By mastering this example, you will enhance your ability to solve string manipulation problems with recursion.
Solution: How many vowels were there?
Understanding the Code
Every recursive code has two functions; the recursive function and the main function.
Driver Function
The recursive function is called within the driver function so lets first look at what it does, from line 20 to 31.
- There are three calls made to the recursive function and for each call, it prints the given string and the total number