Reading data from file created from outside
<p>I'm trying to read from files created outside of the program, but am having some trouble. The program has the user create a file. Then it reads words from two .txt files created outside of the program, and then writes the words to the created file.</p>

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

int main()
{
    string word;

    cout &lt;&lt; "Create file.\n";
    char name[20];
    cin &gt;&gt; name;
    ofstream ost(name, ios::out);

    cout &lt;&lt; "Open first file.\n";
    char filename[20];
    cin &gt;&gt; filename;      
    ifstream ist(filename);
    while(ist &gt;&gt; word) ost &lt;&lt; word &lt;&lt; " ";
    ist.close();

    cout &lt;&lt; "Open second file.\n";
    cin &gt;&gt; filename;
    ifstream isttwo(filename);
    while(isttwo &gt;&gt; word) ost &lt;&lt; word &lt;&lt; " ";
    isttwo.close();

    ost.close();

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

<p>However, when I open the created file in notepad, it comes out blank. Is this because reading into a string is impossible because the files being read were created separately? I'm not really sure. Any help is appreciated.</p>
