/* Copyright 2005 Daniel Cer (daniel.cer@cs.colorado.edu) This work is licensed under the Creative Commons Attribution-NonCommercial- ShareAlike License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/2.5/ or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA. */ #include int main(int argc, char *argv[]) { int file_idx; FILE *fh; for (file_idx = 1; file_idx < argc; file_idx++) { char c; printf("\n%s:\n", argv[file_idx]); if (!(fh = fopen(argv[file_idx], "rb"))) { fprintf(stderr, "Error: can't open %s\n", argv[file_idx]); return 1; } for (c = fgetc(fh); !feof(fh); c = fgetc(fh)) putc(c, stdout); fclose(fh); } return 0; }