I am looking for a simple example on how to copy a file from one directory to another in C. The program should only use cross platform functions that are native to C.
open source file read-only
create destination file for write
while there's still data in source file
read data from source file
write it to destination file
close both files