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: 3926 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  detecting end of file in c++  c detecting end-of-file  detecting end of file c++  detecting end of file in C  detecting end of file in cpp  detecting the end of a file in c++  detecting file opening c++  c++ fstream detecting end of file  detecting end of file in C++ +tutorial