Question: #include #include //copies the file void copyFile(FILE *sourceFile, FILE *destinationFile) { char ch; //Iterating file while( ( ch = fgetc(sourceFile) ) != EOF ) {

#include

#include

//copies the file void copyFile(FILE *sourceFile, FILE *destinationFile) { char ch; //Iterating file while( ( ch = fgetc(sourceFile) ) != EOF ) {

//Copying fputc(ch, destinationFile); } printf(" File Copying Successful!!!! "); }

//Main function int main(int argc, char *argv[]) { //hold file names char source[20], destination[20]; //Files for reading and writing

FILE *sourceFile, *destinationFile;

//Reading file printf(" Input Source File: ");

fgets(source); //Opening file sourceFile = fopen(source, "r");

//Validating file if( sourceFile == NULL ) { printf(" Error!!! Opening input file... Please try again... "); return -1; }

//Reading Destination file location printf(" Input Destination File: ");

fgets(destination); //Opening file in write mode destinationFile = fopen(destination, "w");

//Calling the function copyFile(sourceFile, destinationFile); //Closing file

fclose(sourceFile); fclose(destinationFile);

return 0;

}

how do I fix this error?

#include #include //copies the file void copyFile(FILE *sourceFile, FILE *destinationFile) { char

\f

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!