Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: let there be const

...

Code Block
bgColor#FFcccc
/* sets some internal state in the library */
extern int setfile(FILE *file);

/* performs some action using the file passed earlier */
extern int usefile();

static FILE *myFile;

int setfile(const FILE *file) {
    myFile = file;
    return 0;
}

int usefile() {
    /* perform some action here */
    return 0;
}

...