Why doesn't this change the .txt file?
<p>I'm trying to edit a text file to remove the vowels from it and for some reason nothing happens to the text file. I think it may be because a mode argument needs to be passed in the filestream.</p>

<p>[SOLVED]</p>

<p>Code:</p>

<pre><code>#include "std_lib_facilities.h"

bool isvowel(char s)
{
     return (s == 'a' || s == 'e' || s =='i' || s == 'o' || s == 'u';)
}


void vowel_removal(string&amp; s)
{
     for(int i = 0; i &lt; s.length(); ++i)
             if(isvowel(s[i]))
                      s[i] = ' ';
}

int main()
{
    vector&lt;string&gt;wordhold;
    cout &lt;&lt; "Enter file name.\n";
    string filename;
    cin &gt;&gt; filename;
    ifstream f(filename.c_str());

    string word;
    while(f&gt;&gt;word) wordhold.push_back(word);

    f.close();

    ofstream out(filename.c_str(), ios::out);
    for(int i = 0; i &lt; wordhold.size(); ++i){
            vowel_removal(wordhold[i]);
            out &lt;&lt; wordhold[i] &lt;&lt; " ";}


    keep_window_open();
}
</code></pre>
