title: ifstream does not work in loop
body: <p>I just started programming using C++. I face some problem during execution of ifstream in loop.</p>
  
  <pre><code>do  
  {  
      system("cls");  
      inFile.open ("Account_Details.txt");  
      while (!inFile.eof())  
      {  
           getline (inFile, line);  
           cout &lt;&lt; line &lt;&lt; endl;  
      }  
           inFile.close();  
           cin.ignore(100, '\n');  
           cin &gt;&gt; choice;  
  }  
  while (choice != '1' &amp;&amp; choice != '2');  
  </code></pre>
  
  <p>This is part of my code. When the loop run, it doesnt show data in the txt file.<br>
  Thanks for any help. ^^</p>