mirror of
https://github.com/ish-app/ish.git
synced 2026-01-25 14:06:40 +00:00
17 lines
305 B
C
17 lines
305 B
C
#include <stdio.h>
|
|
|
|
int main(int argc, const char *argv[]) {
|
|
FILE *f = stdin;
|
|
if (argc > 1)
|
|
f = fopen(argv[1], "r");
|
|
if (f == NULL) {
|
|
fprintf(stderr, "cat: ");
|
|
perror(argv[1]);
|
|
return 1;
|
|
}
|
|
|
|
int c;
|
|
while ((c = fgetc(f)) != EOF)
|
|
putchar(c);
|
|
}
|