In my program one of the functions I want to create is going take an input file and replace every vowel with '3'. I've done something but it's not working obviously. I was hoping I could get some help with it:
void replaceVowels(ifstream &dataIn, string outputFile)
{
string line;
ofstream dataOut;
dataOut.open(outputFile.c_str());
while(!dataIn.eof())
{
getline(dataIn, line);
for (int i = 0; i < line.length(); i++)
{
if(line.at(i) != 'a' || line.at(i) != 'e' || line.at(i) != 'i' || line.at(i) != 'o' || line.at(i) != 'u')
{
dataOut << line.at(i);
} else {
line.at(i) = '3';
dataOut << line.at(i);
}
dataOut << endl;
}
}
dataOut.close();
};