C file open modesPritesh
file open mode : File Stream in C Programming
In this tutorial we are going to review all file opening modes in C Programming Language (File Handling).
[box]Refer this article before : What is FILE Pointer ?[/box]
File Opening Mode Chart :
|Mode||Meaning||fopen Returns if FILE-|
|w||Writing||Over write on Existing||Create New File|
|a||Append||–||Create New File|
|r+||Reading + Writing||New data is written at the beginning overwriting existing data||Create New File|
|w+||Reading + Writing||Over write on Existing||Create New File|
|a+||Reading + Appending||New data is appended at the end of file||Create New File|
- File can be opened in basic 3 modes : Reading Mode, Writing Mode, Appending Mode
- If File is not present on the path specified then New File can be created using Write and Append Mode.
- Generally we used to open following types of file in C –
|C Source File||.c|
- Writing on the file will overwrite previous content