![]() |
In C++, EOF stands for End Of File, and reading till EOF (end of file) means reading input until it reaches the end i.e. end of file. In this article, we will discuss how to read the input till the EOF in C++. Read File Till EOF in C++The getline() function can be used to read a line in C++. We can use this function to read the entire file until EOF by using it with a while loop. This method reads the file line by line till the EOF is reached. C++ Program to Read Input Until EOFC++
Output The file contents are: This file contains some random text that can be scanned by a C++ program. |
Reffered: https://www.geeksforgeeks.org
C++ |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 12 |