26 File handling-Reading and opening files in C

Описание к видео 26 File handling-Reading and opening files in C

C File Handling

In this instructional exercise, you will find out with regards to file handling in C. You will figure out how to deal with standard I/O in C using fprintf(), fscanf(), fread(), fwrite(), fseek() etc. with the assistance of models.
A file is a container in computer stockpiling devices utilized for storing information.

Why files are required?
At the point when a program is terminated, the whole information is lost. Storing in a file will save your information regardless of whether the program terminates.
On the off chance that you need to enter an enormous number of information, it will set aside a ton of effort to enter them all.
Nonetheless, in the event that you have a file containing every one of the information, you can undoubtedly access the contents of the file using a couple of commands in C.
You can undoubtedly move your information starting with one computer then onto the next with no changes.

File Operations
In C, you can perform four significant procedure on files, either text or binary:
1 .Creating another file
2. Opening an existing file

Closing a file
Reading from and writing information to a file

Opening a file - for creation and alter
Opening a file is performed using the fopen() function defined in the stdio.h header file.

Reading and writing to a text file
For reading and writing to a text file, we utilize the functions fprintf() and fscanf().
They are only the file renditions of printf() and scanf(). The main difference is that fprintf() and fscanf() expects a pointer to the structure FILE.
Functions fread() and fwrite() are utilized for reading from and writing to a file on the plate respectively in case of binary files.

Zeedup Course
https://zeedup.com/home/course/c-prog...
www.zeedup.com

Комментарии

Информация по комментариям в разработке