5. What are all the file opening modes in c?
Ans:
These are
1. "r" ->It open the file in read mode.It points the first character in the file
2."w" ->If the file exists,its contents are overwritten.If the file doesn't exist, a new file is created.Retruns Null, if unable to open.
3. "a"->If file exists it open the file and set the pointer to the last character in it.If the file is doesn't exist, a new file is created.
4."r+" ->Searches file. If is opened successfully then loads it into memory and sets up a pointer which points to the first character in it. Returns NULL, if unable to open the file.
5."w+" ->Searches file. If the file exists, its contents are overwritten. If the file doesn’t exist a new file is created. Returns NULL, if unable to open file.
6."a+"-> Searches file. If the file is opened successfully then loads it into memory and sets up a pointer which points to the first character in it. If the file doesn’t exist, a new file is created. Returns NULL, if unable to open file.
|