title: After freopen(..,"r",stdin) + fclose(stdin), further std::cin doesn't work
body: <pre><code>int main(){
  
      int a,b;
  
      std::cin &gt;&gt; a &gt;&gt; b;           // first
  
      freopen("test.txt","r",stdin);
      std::cin &gt;&gt; a &gt;&gt; b;           // second
      fclose(stdin);
      cout &lt;&lt; a &lt;&lt; ", " &lt;&lt; b &lt;&lt; endl;
  
      freopen("test2.txt","r",stdin);
      std::cin &gt;&gt; a &gt;&gt; b;          // third
      fclose(stdin);
      cout &lt;&lt; a &lt;&lt; ", " &lt;&lt; b &lt;&lt; endl;
  
      std::cin &gt;&gt; a &gt;&gt; b;          // fourth
  
      return 0;
  }
  </code></pre>
  
  <p>This block of code is to have a mixture of input from terminal and files.
  The first, second and third cin works fine, but the fourth failed. It seems that fclose(stdin) has no function here.</p>