fopen():-
C fopen is a C library function used to open an existing file or create a new file.It is compulsory to use for handling the file.Syntax:-
It Contain two Parameters:-
1)filePath: The first argument is a pointer to a string containing the name of the file to be opened.
If the file is stored at some specific location, then we must mention the path at which the file is stored. For example, a file name can be like "any drive:// any folder/any file.txt".
2)mode: The second argument is an access mode,in which mode file is open.It is a string.
There are Different types of modes.
Note:- c open function return null in case of a failure.
EXAMPLE:-
(*) The above example will create a file called anyfile.txt.
(*)The w means that the file is being opened for writing, and if the file does not exist then the new file will be created.
Comments
Post a Comment