I need to display 24 lines of text from a file, then ask user to press enter and display 24 for lines, etc, etc, til end of file, but have no clue. My book doesn't give any advice on how to perform the operation.....Here's my code. Thanks for any clues.
Code:
#include <fstream>
#include <iostream>
using namespace std;
int main()
{
const int SIZE = 5000;
char fileName[SIZE];
fstream file;
int count = 0;
cout << "Enter the file name:";
cin >> fileName;
file.open(fileName, ios::in);
file.getline(fileName,SIZE);
while (!file.eof())
{
count++;
cout<<count<<": ";
cout << fileName << endl;
file.getline(fileName, SIZE);
}
file.close();
system("PAUSE");
return 0;
}