#1. (IN C PROGRAMMING) Type in and run the program presented in this chapter. Check the program's results by comparing the original file you chose to copy with the filename you entered to copy and ensure the two are the same.
Program for reference :
// Program to copy one file to another #include int main (int) argc, char *argv[]) { proting } FILE *in, *out; int C; } Wypad if (argc != 3 ) { fprintf (stderr, "Need two files names\n"); return 1; } byd if ( (in = fopen (argv[1], "r")) NULL) { fprintf (stderr, "Can't read %s.\n", argv[1]); return 2; } - while ( (c = getc (in)) != EOF ) putc (c, out); if ( (out = fopen (argv[2], "w")) NULL) { fprintf (stderr, "Can't write %s.\n", argv[2]); return 3; == return 0; version 2 printf ("File has been copied.\n"); fclose (in); fclose (out); ==
#1. (IN C PROGRAMMING) Type in and run the program presented in this chapter. Check the program's results by comparing t
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am