input/output for a file in c++
<pre><code>   #include &lt;iostream&gt;
   #include &lt;fstream&gt;
   #include &lt;string&gt;
   using namespace std;

   // Main Routine

   void main() { 
      char in;
      string s,m;
      fstream f;

   // Open file
      cout &lt;&lt; "Positive Filter Program\n"&lt;&lt; endl;
      cout &lt;&lt; "Input file name: ";
      cin &gt;&gt; s;
      cout &lt;&lt; "Output file name: ";
      cin &gt;&gt; m;
      f.open(s.data(),ios::in);
      f.open(m.data(),ios::out);

    // Loop through file

    if(f.is_open())
    {  
        while(f.good())
        {
            f.get(in);
            f&lt;&lt;in;
            cout &lt;&lt; "\nFinished!"&lt;&lt; endl;
        }
    }
    else cout &lt;&lt; "Could not open file";

    // Close file
    f.close();

    }
</code></pre>

<p>I am not sure what I am doing wrong here. In this program I am trying to cin the file name that would input, and then would output onto what file name that you typed in.</p>
