The program should find and delete all vowels in a word that is user entered. This is what I have so far and I know it should be essentially this format I just don't know how to set enteredword and word equal to each other. thanks.
Code:
#include <string>
#include <iostream>
using namespace std;
void vowelremover(string&);
string word;
int main ()
{
//string word;
cout << "Enter a word of which you want the vowels removed: ";
cin >> word;
vowelremover(word);
cout << "The word without vowels is: " << word << endl;
return 0;
}
void vowelremover (string& enteredword)
{
string enteredword = word;
int posvowel;
posvowel = enteredword.find("a,e,i,o,u,A,E,I,O,U");
while (posvowel >= 0 && posvowel < enteredword.length())
{
enteredword.erase(posvowel, 1);
posvowel = enteredword.find("a,e,i,o,u,A,E,I,O,U");
}
}