I'am trying to build a program where I have to find all the vowels in a string.
I have managed to make this work when I check for a string where I declare a variable for example:
string phrase = "aabb eebb";
my code works perfectly and it finds four vowels, however when I changed the code to change the variable due to user input for example:
string phrase;
cin >> phrase;
and I type in the exact same string it only finds 2 vowels.
I just don't really understand the difference between the space in the string " " and the space in the input as to why I am getting two different answers. If someone could help out that would be awesome.
Bookmarks