In this Program to Copy Contents of One File to Another in C++ in C Programming Language. We have copied the one file into another file. The program first will ask you to enter the first file name after that ask for entering the second file name than program copied the first file into the second file.
We have to enter both file name with extension cause file always have extension or folder not this is useful when you want to merge two files or in other words, we can say that merge two file.
Output:
Enter source file with extension: source.txt
Enter destination file with extension : destination.txt
source file date successfully copied to destination file !!
open destination file and check !!!
Source.txt
Destination.txt
need an explanation for this answer? contact us directly to get an explanation for this answer