Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

question on checking for EOF

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Before you read this message take into account that I'm new to programming and some things may seem like utter rubbish but I know what I'm trying to ask.

So i'm reading a value from an array and I want to check if it's EOF or not i.e

if (input[arraypos] == 'EOF')
(file_reading = false);

sort of thing


Thanx

Spud
 

ifstream infile("input.txt");

Code:
while(!infile.eof && infile.peek() != EOF)
{

   read in from file

}

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top