I have one error in my code
Error 1 fatal error C1075: end of file found before the left brace '{' at line 50
The program is suppose to ask the user for a filename, read and display the file. Then show 24 lines per screen. I thought I checked all my brackets, but 1 error remains. Any guidance would be greatly appreciated.
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
char fileName[80];
const int SIZE = 80;
int count = 0;
char ch;
fstream file;
// Get filename
cout << "Pease enter a filename: ";
cin >> fileName;
//Open the file
file.open(fileName, ios::in);
if (!file)
{
cout << fileName << " Cannot open file, please check for file.\n"; // Error Opening file
return 0;
}
// Get characters from file and display
file.get(ch);
while (!file.eof())
{
if(count==24)
system("pause");
count=0;
}
count++;
cout << ch;
file.get(ch);
{
file.close();
system("pause");
return 0;
}