I'm just trying to scroll through a input file, fin is the object name and it goes into an infinite loop. I'm using this check
!fin.eof what am I missing or not understanding?
#include <iostream>
#include <fstream>
#include <cctype>
#include <cstdlib>
#include <string>
using namespace std;
// ------ PROTOTYPES ---------------------------------------------
// ****** MAIN ***************************************************
int main()
{
char over[] = " over ";
char to[] = " to ";
cout << over;
string fName = "iFile.txt";
ifstream fin(fName.c_str());
char buffer[80];
if(!fin)
{
cerr << "\nCouldn't open " << fName;
exit(1);
}
while(!fin.eof())
{
cout << over[0];
}
return 0;
}