title: I/O file stream C++
body: <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;cstring&gt;
  #include &lt;fstream&gt;
  using namespace std;
  
  int main() 
  {
  
      string temp;
  
      ifstream inFile;
      ofstream outFile;
  
      inFile.open("ZRMK Matched - 010513.txt");
      outFile.open("second.txt");
  
      while(!inFile.eof()) {  
  
          getline(inFile, temp);
          if (temp != "") {
              getline(inFile, temp);
              outFile &lt;&lt; temp;
          }
      }
  
      cout &lt;&lt; "Data Transfer Finished" &lt;&lt; endl;
  
      return 0;
  }
  </code></pre>
  
  <p>I'm having difficulty getting this to work. When I execute the program it cycles for awhile and then terminates without finishing -- it doesn't output any lines of text to the output file. Any help would be appreciated.</p>