written 7.9 years ago by | modified 2.9 years ago by |
Mumbai University> FE > Sem 2> STRUCTURED PROGRAMMING APPROACH
Marks: 4 M
Year: Dec 2016
written 7.9 years ago by | modified 2.9 years ago by |
Mumbai University> FE > Sem 2> STRUCTURED PROGRAMMING APPROACH
Marks: 4 M
Year: Dec 2016
written 7.9 years ago by |
Files: A file represents a sequence of bytes on the disk where a group of related data is stored. File is created for permanent storage of data. It is a readymade structure.
There are five major operations that can be performed on a file are:
Creation of file
Opening an existing file
Reading data from a file
Writing data in a file
Closing a file
fopen()
The fopen() function is used to create a new file or to open an existing file. General Syntax : *fp = FILE *fopen(const char *filename, const char *mode);
fread()
fread() function is used to read is a binary file. A Binary file is similar to the text file, but it contains only large numerical data. Function Reads Block of Data from Binary Mode File and Assign it to the Region of Memory Specified.[i.e Reads Block of Data From Binary File and Assign it to Some Memory ]
fwrite()
fwrite() function is used to write is a binary file. Function Writes Block of Data to Binary Mode File.[i.e Writes Block to Binary File]