I'm new to programming and I'm trying to understand what my professor is asking me to do.
The instructions say,
"Write a program to copy a data file "lab01.dat" to a new file "lab01.out"
The instructions probably seem self explanatory but someone please explain this to me. I don't know if I understand what exactly he wants me to do or how to do it.
In class all we learned how to do was read, write, open, close a file, etc.
I don't remember him saying anything about copying a data file to a new file. And I can't find anything in the book.
I feel like this is really simple and I'm making it way more complicated than it is.
Also don't rely on is_open or eof.
They're both wrong.
is_open doesn't tell you if an error happened and it is safe to write.
eof is triggered only AFTER it gets "touched", copying the last character twice in this case.
Also copying with such a small buffer (1 byte) is pretty slow.