Reputation: 319
when I try to write into a file, do I need to input EOF as well, or after inputting, it is systematically there? (C++)
Upvotes: 0
Views: 1585
Reputation: 895
On modern operating systems, files are not terminated by EOF (end of file) characters. EOF characters you'd be working with in C++ or another programming language are just a convenience provided by the language.
You do not need write EOF. All you need to do is write to the stream (probably an ofstream,) flush and close the stream and you're done.
Upvotes: 0
Reputation: 3773
EOF is not a real character, it's just a presentation of the end of a file used by some libs or languages. So, when you read a file, you may get an EOF at the end, but when you write a file, you just write everything, flush and close the output stream. That's all.
Upvotes: 1