Types of File: 1.text File 2.binary File
Types of File: 1.text File 2.binary File
1.Text file
2.Binary file
1. Text file:
2.Binary file:
ftell( ):
ftell will give the current position/location of the file, relative to
the beginning of the file.
Prototype:
long int ftell(FILE *stream);
fseek( ):
fseek ( ) will move the file pointer to the required position in a
file.
Prototype:
llong int ftell(FILE *stream, long offset ,int fromcohere);
int fread(void *PInArea, int element size, int count, FILE *sp);
PInArea is a pointer to the input area in memory.
File write -fwrite:
Fwrite writes a specified number of items to a binary file.
feof( ): is used to check if the end of file has been reached. If the
file ia at the end that is if all data have read the function returns
non zero(true), if end of file has not been reduced zero (false) is
returned.
int-ferror(FILE *Stream);