Here is the code i have so far. The program reads lines 1 and 2 but not 3. I only want it to display line number 1 or number 2 or number 3 or any number in the list and the associated data on that line and only on that line.
/*This program retreives computer data from a file.
*
*Input: The computer terminal number.
*Output: All information about the Computer.
*****************************************************/
#include <iostream> //cin, cout, <, >
#include <fstream> //ifstream, ofstream
#include <string> //string, getline()
#include <cassert> //assert()
using namespace std;
int i;
string lineofText;
int main()
{
ifstream inStream;
inStream.open("Computerlist.txt"); //Open file for reading
assert( inStream.is_open()); //verifies the file is open
if (inStream.fail()) //If opening the file fails
cerr << "Error! Couldn't open " << "Computerlist.txt" << " file for reading ";
cout << "Enter the computer terminal number: ";
cin >> i;
for (;

{
getline(inStream, lineofText);
if ( inStream.eof() ) break;
cout << lineofText;
}
}
any good or bad comments appreciated.
Thank you.