I'm trying to remove vowels from a text file and am having some trouble. I'm receiving a compiler error in line 6 saying
invalid conversion from const char to char
I'm pretty sure this has to do with the way I'm setting up the file stream in my code. I'm using fstream since it's used for reading and writing, but I didn't include any of the open modes because I thought I could write and read to/from the file without them (I'm pretty sure you have to use one, I'm just not sure which one.) Also, I'm not sure if the way I set up the equals operator is legal or not(will it read it as if s[i] is equal to a or e or i or o or u).
Code:
#include "std_lib_facilities.h"
void vowel_removal(string& s)
{
for(int i = 0; i < s.length(); ++i)
if(s[i] == ('a' || 'e' || 'i' || 'o' || 'u')) s[i] = " ";
}
int main()
{
cout << "Enter file name.\n";
string filename;
cin >> filename;
fstream f(filename.c_str());
string word;
while(f>>word){
vowel_removal(word);
f << word;
}
keep_window_open();
}