/* openstr.c */ #include #include void main(int argc, char *argv[]) { FILE *tietovirta; /* ... */ if(argc == 1) tietovirta = stdin; else if ((tietovirta = fopen(argv[1], "r")) == NULL) { perror("Syottotiedoston avaus epaonnistui"); exit(1); } /* ... */ fclose(tietovirta); }