C – File

Home/C - Tutorial/C – File
C – File 2017-06-02T19:35:42+00:00

 

 

 

 

File Description
fopen() The fopen () function opens a file whose name is pointed to by ‘filename’ and returns the stream that is associated with it.
fclose() The fclose function closes the file associated with stream and flushes its buffer (i.e., it writes any data still remaining in the disk buffer to the file).
fputc() The fputc() function writes the character ch to the specified stream at the current file position and then advance the file position indicator.
fgetc() The fgetc() function returns the next character from the specified input stream and increments the file position indicator. The character is read as an unsigned char that is converted to an integer.
fputs() The fputs() function writes the content of the string pointed to by str to the specified stream. The null terminator is not written.
fgets() The fgets() function reads up to num-1character from stream and store them into a character array pointed to by str.
fscanf() The fscanf function works exactly like the scanf function except that it reads the information from the stream specified by stream instead of standard input device.
fprintf() The fprintf() function outputs the values of the arguments that makes up the argument list as specified in the format string to the stream pointed to by stream.
putc() The putc() function writes the character ch to the specified stream at the current file position and then advance the file position indicator.
getc() he getc() function returns the next character from the specified input stream and increment file position indicator. The character is read as an unsigned char that is converted to an integer.

 

Prev Next