title: Using ios::Nocreate flag results in "undeclared identifier" error
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1062861/iosnocreate-error-while-compiling-a-c-code">ios::nocreate error while compiling a C++ code</a>  </p>
  </blockquote>
  
  
  
  <p>i have been working on how to create a simple lexical compiler in c++/c# but it seems i have a an error when i try to compile the program the error is</p>
  
  <pre><code>error c2065 'nocreate' undeclared identifier 
  </code></pre>
  
  <p>how can i handle this problem??but im thinking maybe it has to do with the fstream header,any ideas on how i can handle it??</p>
  
  <p>this is the code where it is giving me an error</p>
  
  <pre><code>loadTransitionTable( );
  
      fstream File("input.txt", ios::in|ios::Nocreate);
  
      if (!File)
      {
         cout&lt;&lt;"\n Unable to open the input file."&lt;&lt;endl;
         cout&lt;&lt;"\n Press any key to exit.";
  
         getch( );
         exit(0);
  </code></pre>