1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <stdio.h> #include "sb.h" int main(int argc, char** argv){ FILE* in; int c; if (argc >= 2) in = fopen(argv[1], "r"); else in = stdin; if (in == NULL){ perror(argv[1]); return 1; } while ( (c = fgetc(in)) != EOF){ } }