Something
public text v1 · immutable#include <stdio.h>
#define MAXCHAR 200
main(int argc, char argv[])
{
FILE *fp[argc-1];
int x = 0;
int y;
char s[MAXCHAR];
while(x < argc) {
fp[x] = fopen(*++argv, "r");
if(fp[x] == NULL) {
fprintf(stderr, "ERROR: Kan bestand %s niet openen\n", argv);
exit(1);
}
y = 1;
printf("Bestand: %s\n", argv);
while(fgets(s, MAXCHAR, fp[x]) != NULL) {
printf("%d: %s", y, s);
y++;
}
printf("\n\n\n");
x++;
}
}