File Modes In C

  • r - open a file in read-mode, set the pointer to the beginning of the file.
  • w - open a file in write-mode, set the pointer to the beginning of the file.
  • a - open a file in write-mode, set the pointer to the end of the file.
  • rb - open a binary-file in read-mode, set the pointer to the beginning of the file.
  • wb - open a binary-file in write-mode, set the pointer to the beginning of the file.
  • ab - open a binary-file in write-mode, set the pointer to the end of the file.
  • r+ - open a file in read/write-mode, if the file does not exist, it will not be created.
  • w+ - open a file in read/write-mode, set the pointer to the beginning of the file.
  • a+ - open a file in read/append mode.
  • r+b - open a binary-file in read/write-mode, if the file does not exist, it will not be created.
  • w+b - open a binary-file in read/write-mode, set the pointer to the beginning of the file.
  • a+b - open a binary-file in read/append mode.

0 comments:

Followers

 
C - Programming -