Detecting End-of-file - C++

Advertisements

  Top Tutorials     New Tutorials     Submit     Login     Register  

Tutorial Detail

Detecting End-of-file - C++

Detection of End-of-file condition is necessary for preventing any further attempt to read data from the file.
http://www.onlinehowto.net/Tutorials/29/Detecting-End-of-file---C++/94/1
  • Total Hits: 14637

  • Average Rating :
    URL RatingURL RatingURL RatingURL RatingURL Rating

  •  

  • Total Votes: 142 votes

  • Category: C and C++/File Manipulation

  • Submitted on: 2008-04-16 01:55:05

  • Submitted By: Shekhar

  • Set as Favorite

Description:

Detection of End-of-file condition is necessary for preventing any further attempt to read data from the file. The end-of-file can be detected in two ways. The examples shows the two ways in which the end-of-file can be detected. While loop terminates when last returns a value of zero on reaching the end-of-file condition. The loop may also terminate due to otherfailures as well. eof() is a member of ios class. It returns a non-zero value if the end-of-file(EOF) is encountered and a zero otherwise.    More detail...

Rating Detail

 Stars  Percentage  Total Vote
 One star  Vote LeftVote MiddleVote Right 38.03%  54
 Two starsTwo star  Vote LeftVote MiddleVote Right 9.86%  14
 Three starsThree starsThree stars  Vote LeftVote MiddleVote Right 11.27%  16
 Four starsFour starsFour starsFour stars  Vote LeftVote MiddleVote Right 11.27%  16
 Five starsFive starsFive starsFive starsFive stars  Vote LeftVote MiddleVote Right 29.58%  42

Caste Your Vote

 Rating  Selection  Guidelines
 Poor:     Very disappointing, useless.
 Fair:     Below average, disappointing but not useless.
 Good:     About average in its class.
 Very Good:     Above average for its category.
 Excellent:     One of the best Tutorials in its category.





Advertisements
Advertisements