#include /* C example */ #include int main(int argc, char **argv) { FILE *in1; FILE *in2; int i; int j; /* Open two input files. */ in1 = fopen("infile1", "r"); if (in1 == NULL) { fprintf(stderr, "can't open infile1.\n"); return EXIT_FAILURE; } in2 = fopen("infile2", "r"); if (in2 == NULL) { fprintf(stderr, "can't open infile2.\n"); return EXIT_FAILURE; } fscanf(in1, "%d", &i); fscanf(in2, "%d", &j); printf("%d %d\n", i, j); fclose(in1); fclose(in2); return EXIT_SUCCESS; }