You are on page 1of 1

Only reading

possible. No, create


the file if it does not
exist.

Only writing is possible. Create the file if it


does not exist; otherwise, erase the old
w Write content of the file and open a blank file.

Only writing is possible. Create a file; if it


does not exist, otherwise open the file and
write from the end of the file. (Do not erase
a Append the old content).

Reading and writing are possible. Create a


Reading + file if it does not exist, overwriting existing
r+ Writing data. Used for modifying content.

Reading + Reading and writing are possible. Create a


w+ Writing file if it does not exist. Erase old content.

Reading and writing are possible. Create a


Reading + file if it does not exist. Append content at th
a+ Appending end of the file.

http://www.btechsmartclass.com/c_programming/C-File-Handling-
Functions.html

Programming Example 2
T

his programming example shows us how a file is opened in read mode.

You might also like