...
| Code Block | ||
|---|---|---|
| ||
char buf[1024]; FILE *file; /* InitializedInitialize file */ if (fgets(buf, 1024, file) == NULL) { /* set error flag and continue */ } printf("Read in: %s\n", buf); |
...
| Code Block | ||
|---|---|---|
| ||
char buf[1024]; FILE *file; /* InitializedInitialize file */ if (fgets(buf, 1024, file) == NULL) { /* set error flag and continue */ strcpy(buf, "fgets failed"); } printf("Read in: %s\n", buf); |
...