Hi all, sorry to once agian come begging for help, but the professor wants us this time to have the program have a function read the word then for each letter have another function confrim if the letter is a vowel or not, then have the first function remove the vowel from the word. Heres my code and so far having no luck with errors that really are just puzzling me. I've tried working on this code myself for two weeks, without help, but having no luck, and it's already late XD, all of you have been helpful in the past I was hoping I can get help agian heres the code
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
void removeVowel(string);
bool isVowel(char);
int main()
{
string word;
cout << "Vowel Remover 1.0" << endl;
cout << "--------------------------------------------------"<< endl; // just a decoration.
cout << "This program will remove any vowel from a word you enter" << endl;
cout << "Please enter in a word now" << endl;
getline(cin,word);
removeVowel(word);
return 0;
}
bool isVowel (char i)
{
if (i=='a'||i=='e'||i=='i'||i=='o'||i=='u'||i=='A'||i=='E'||i=='I'||i=='O'||i=='U')
return true;
else
return false;
}
void removeVowel(string word)
{
string.str(word)
for (int i=0; i < string.length();i++)
{
if(isVowel(string.at(i))
{
word{i}= " ";
}
}
cout << word;
}