File

  • FILE

  • fopen

FILE* fopen (char* name, char* mode);

used to openning file with file name name.

  • mode

    • “r” : read
    • “w” : write (will be overwrited), (make new file if it doesn’t exist and possible)
    • “a” : append (make new file if it doesn’t exist and possible)
    • “rb” : binary-read
    • “wb” : binary-write (will be overwrited), (make new file if it doesn’t exist and possible)
    • “ab” : binary-append (make new file if it doesn’t exist and possible)
  • getc

int getc (FILE* fp);
  • putc
int putc (int c, FILE* fp);
  • getchar
#define  getchar()  getc( stdin )
  • putchar
#define  putchar(c)  putc( (c), stdout )
  • fscanf
int fscanf (FILE* fp, char* format, ...);
  • fprintf
int fprintf (FILE* fp, char* format, ...);
  • fclose
int fclose (FILE* fp)