0% found this document useful (0 votes)
27 views

File Handling Function

This document lists and describes common file handling functions in C including functions for opening, closing, reading, writing, formatting, and positioning files. Some key functions are fopen() to open a file, fclose() to close a file, fgetc() and fputc() to read and write characters, fgets() and fputs() to read and write strings, and feof() to check for end of file. Additional functions allow writing formatted data, moving the file position pointer, and deleting files. More details on each function are available at the provided link.

Uploaded by

Suman Mandal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

File Handling Function

This document lists and describes common file handling functions in C including functions for opening, closing, reading, writing, formatting, and positioning files. Some key functions are fopen() to open a file, fclose() to close a file, fgetc() and fputc() to read and write characters, fgets() and fputs() to read and write strings, and feof() to check for end of file. Additional functions allow writing formatted data, moving the file position pointer, and deleting files. More details on each function are available at the provided link.

Uploaded by

Suman Mandal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

File Handling Pre define Function

File handling functions Description


fopen () fopen () function creates a new file or opens an existing file.
fclose () fclose () function closes an opened file.
getw () getw () function reads an integer from file.
putw () putw () functions writes an integer to file.
fgetc () fgetc () function reads a character from file.
fputc () fputc () functions write a character to file.
gets () gets () function reads line from keyboard.
puts () puts () function writes line to o/p screen.
fgets () fgets () function reads string from a file, one line at a time.
fputs () fputs () function writes string to a file.
feof () feof () function finds end of file.
fgetchar () fgetchar () function reads a character from keyboard.
fprintf () fprintf () function writes formatted data to a file.
fscanf () fscanf () function reads formatted data from a file.
fputchar () function writes a character onto the output screen from
fputchar ()
keyboard input.
fseek () fseek () function moves file pointer position to given location.
ftell () ftell () function gives current position of file pointer.
rewind () function moves file pointer position to the beginning of the
rewind ()
file.
getc () getc () function reads character from file.
getch () getch () function reads character from keyboard.
getche () function reads character from keyboard and echoes to o/p
getche ()
screen.
getchar () getchar () function reads character from keyboard.
putc () putc () function writes a character to file.
putchar () putchar () function writes a character to screen.
printf () printf () function writes formatted data to screen.
sprinf () sprinf () function writes formatted output to string.
scanf () scanf () function reads formatted data from keyboard.
remove () remove () function deletes a file.
fflush () fflush () function flushes a file.

For details of each function Please follow this Link:


File Handling Pre define Function

https://fresh2refresh.com/c-programming/c-file-handling/fscanf-fprintf-ftell-rewind-functions-c/

You might also like