Home > Software design >  A simple file handling code at C stuck at do/while loop
A simple file handling code at C stuck at do/while loop

Time:12-19

int main(void) {
    int status = EXIT_SUCCESS;
    FILE *in;

    struct sigrecord {
        int signum;
        char signame[10];
        char sigdesc[100];
    } sigrec;
    if ((in = fopen("signals.txt", "r")) == NULL) {
        fputs("Cannot open signals.txt file\n", stderr);
        return EXIT_FAILURE;
    }
    do {
        int n = fscanf(in, "%d%9s%*[ \t]           
  • Related