Versions Compared

Key

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

...

Code Block
bgColor#ffcccc
void do_stuff(void) {
  FILE *logfile = fopen("log", "a");
  if(logfile == NULL) {
    /* handle error */
  }

  /* Writewrite logs pertaining to do_stuff() */

  /* ... */
}

int main(void) {
  FILE *logfile = fopen("log", "a");
  if(logfile == NULL) {
    /* handle error */
  }

  /* Writewrite logs pertaining to main() */

  do_stuff();

  /* ... */
}

...

Code Block
bgColor#ccccff
void do_stuff(FILE *logfile) {
  /* Writewrite logs pertaining to do_stuff() */

  /* ... */
}

int main(void) {
  FILE *logfile = fopen("log", "a");
  if(logfile == NULL) {
    /* handle error */
  }

  /* Writewrite logs pertaining to main() */

  do_stuff(logfile);

  /* ... */
}

...