How do I read a file until EOF in C++? And could someone give me a cheat sheet for it? | Sololearn: Learn to code for FREE!

+3

How do I read a file until EOF in C++? And could someone give me a cheat sheet for it?

Input until EOF

10/13/2018 3:37:58 PM

Yang Tuấn Anh

1 Answer

New Answer

+2

using a while loop ifstream f("xyz.txt"); while(!f.eof()) {} file will be read till one character before eof.