Filehandling functions in C are a set of functions that allow programmers to read from and write data to files. These functions are part of the C standard library and are typically included in programs that need to interact with files on disk.
Here are some commonly used file handling functions in C:
fopen() - This function is used to open a file. It takes two arguments - the name of the file to open and the mode in which to open it (read, write, append, etc.).
fclose() - This function is used to close a file that was opened using
fopen().
fgetc() - This function is used to read a single character from a file.
fgets() - This function is used to read a line of text from a file.
fputc() - This function is used to write a single character to a file.
fputs() - This function is used to write a string of text to a file.
fprintf() - This function is used to write formatted text to a file, similar to the
printf() function.
fscanf() - This function is used to read formatted text from a file, similar to the
scanf() function.
Markdown for AI
A clean, structured version of this page for AI assistants and LLMs.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
File handling functions in C are a set of functions that allow programmers to read from and write data to files. These functions are part of the C standard library and are typically included in programs that need to interact with files on disk.
Here are some commonly used file handling functions in C: