I am trying to write a recursive function to check if a string contains a vowel..
Here is my code but it does not return the correct value, can anyone help me please:
1 2 3 4 5 6 7 8 9 10 11
#include <iostream>
#include <string>
usingnamespace std;
string s = "aeiouAEIOU";
bool containsVowel(string str){
if(s.find(str.at(0)) == string::npos)
returnfalse;
elsereturn containsVowel(str.substr(1)); // I think there is something wrong with this line here, but can't figure out how to fix it... I need to put "true" somewhere in this line here right?
}