Copy a file with an int character and checked lifecycle

Write a program copying source.txt to the distinct path copy.txt byte for byte, using fgetc/fputc. Use binary modes so the C program does not request text translation. Store each fgetc result in int; explain why char is unsuitable for representing all byte values plus EOF. Report copied=k only after successful reads, writes and both closes. Handle absent input and failed output opening. The output may be partial if a later write fails; no atomic-replacement feature is required. Include empty and multiline file tests.


