C File Management

Random access to files

Sometimes it is required to access only a particular part of the and not the complete file. This can be accomplished by using the following function:
1 > fseek


fseek function

The general format of fseek function is a s follows:
    fseek(file pointer,offset, position); 
This function is used to move the file position to a desired location within the file. Fileptr is a pointer to the file concerned. Offset is a number or variable of type long, and position in an integer number. Offset specifies the number of positions (bytes) to be moved from the location specified bt the position. The position can take the 3 values. Value Meaning
0 Beginning of the file 
1 Current position 
2 End of the file.
 
        


Make Comments..!!


Oops!! No posts from user.

Download Android App