Question: (e) (i) Given the following simple program, explain what the program does. (ii) Give a sample command line usage for the program. (e) (i) Given

(e) (i) Given the following simple program, explain what the program does.(e) (i) Given the following simple program, explain what the program does. (ii) Give a sample command line usage for the program.

(e) (i) Given the following simple program, explain what the program does. (i) Give a sample command line usage for the program. 2 * sample test program - testProgram.c 3 4 5 int main(int argc, char *argv[) #include 6 FILE *fptr1, *fptr2; int c; 8 9 if (argc 3) printf( "wrong usage "); else 12 13 14 if ((fptr1fopen (argv[ 1 ], "r")) ! NULL) if ((fptr2fopen (argv[2], "wr"))NULL) 15 16 17 18 fseek(fptr2, , END); SEEK while ((cfgetc(fptr1))! EOF) fputc(c, fptr2); 19 20 21 else printf("Can 't open file \"%s\" ", argv[ 2 ] ); else printf("Can 't open file \"%s\" ", argv[1]); 23 24 return

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 Databases Questions!