Random Access to Files In C

So far we have discussed file functions that are useful for reading and writing data sequentially. However ,there are occasions, when we are interested in accessing only a particular part of the file. This can be achieved with fseek() function. The prototype of fseek() is

Int fseek(FILE *fp, long numbytes, int origin);

Where fp is the file pointer ,numbytes, a long integer, is the number of bytes from origin which will become the new current position, and origin is one of the macros, defined in stdio.h, which are shown in table –

img


About the Author



Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.

We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc





 PreviousNext