Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ffcccc
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
bgColor#ccccff
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);

...