1.

किसी फाइल को खोलने के लिए किस फंक्शन का उपयोग किया जाता है? उसका सिण्टैक्स बताइए।

Answer»

Answer:

fopen() FUNCTION is used to open a file to perform operations such as reading, writing etc. In a C program, we DECLARE a file pointer and use fopen() as below. fopen() function creates a new file if the mentioned file name does not exist.

Declaration: FILE *fopen (const char *filename, const char *mode)

fopen() function is used to open a file to perform operations such as reading, writing etc. In a C program, we declare a file pointer and use fopen() as below. fopen() function creates a new file if the mentioned file name does not exist.

FILE *fp;

fp=fopen (“filename”, ”‘mode”);

Where,

fp – file pointer to the data type “FILE”.

filename – the actual file name with FULL path of the file.

mode – REFERS to the operation that will be performed on the file. Example: r, w, a, r+, w+ and a+. PLEASE refer below the description for these mode of operations.

Explanation:

HOPE THIS HELPS U MY FRD !

PLZ MARK AS BRAINLIEST !

>>>>>>>THANK U<<<<<<

#keep smiling :)



Discussion

No Comment Found