/* link this with sortfile from 1.c */ #include #include int main(int argc, char **argv) { FILE *infp, *outfp; extern void sortfile(FILE *in, FILE *out); if (argc != 3) { printf("usage: %s file1 file2\n", argv[0]); return 1; } if ((infp = fopen(argv[1], "r")) == NULL) { perror(argv[1]); return 1; } if ((outfp = fopen(argv[2], "w")) == NULL) { perror(argv[2]); return 1; } sortfile(infp, outfp); return 0; }