title: This program cannot be run in DOS mode
body: <p>I was trying out a program and compiling and running it with GCC but it throws error that it cannot be run in dos mode. Here is my code</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;fstream&gt;
  using namespace std;
  int main(int argc, char *argv[]) 
  { 
      ifstream is; 
      is.open("text1.txt",ios::binary);
      ofstream outfile;
      outfile.open("text2.txt",ios::binary);
      char ch; 
      while (is.get(ch)) 
      { 
          outfile.put(ch);
          cout &lt;&lt; ch;  //this shows
      }
      is.close();
      outfile.close();
      getchar();
      return 0; 
  }
  </code></pre>
  
  <p>But this code works perfectly fine in Visual Studio. Any suggestions?</p>