Yes. You use pos to count the number of characters read, but then you don't use pos to control the number of characters to write. If you did this correctly, your use of feof would be okay here,...