Networking, Programming and Graphics Tutorials

Detecting End of file - C++ [1/2]

Type: Code Networking, Programming and Graphics Tutorials
Detecting End of file - C++
Level: Expert Networking, Programming and Graphics Tutorials Networking, Programming and Graphics Tutorials Networking, Programming and Graphics Tutorials 
Detecting End of file - C++
Date: 2006-Dec-12
Detecting End of file - C++
Visited: 3121 times
Detecting End of file - C++
Rating: Detecting End of file - C++
Detecting End of file - C++
Author: Alex Plumpton

Means to Learn
This tutorial will show you how to detect end of file (EOF) .

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.

Example


While(last); If(last1.eof()!=0){};
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 .

Networking, Programming and Graphics Tutorials - Detecting End of file - C++ [1/2] - Networking, Programming and Graphics Tutorials

Need a specific tutorial? Do not hesitate and submit a request!
Related Tags: detecting end of file C  "detecting end of file"  Detecting end-of-file in c++  detecting end of file C++  c++: Detecting End-of-file  detecting EOF select  c++ detecting COM port  (local-file) (remote-file) usage:put local-file remote-file  read file C end of file  "c++" read file EOF FILE*  End of a c++ file  end of file C++  end of file c++ FILE  FILE C++ end of file  end of file c++  end of file c++  end of file value  FILE C++  end of file EOF c++  example with end of file