Display certain number of lines from text file
<p>Hi I am trying to display the first 10 lines of text in a file. However it just display the whole file instead of limiting it to 10 lines. </p>

<pre><code>int count = 0;

string input = "";

fstream file;

file.open("Test.txt", ios::in);

for (int i = 0; i &lt;= 10; ++i) {

    getline(file, input);

    cout &lt;&lt; input; 
}
</code></pre>