Search⌘ K

Random Access

Explore the concept of random access in C file handling by learning to use the fseek function. Understand how to move the file pointer to different positions to read or write data, work with binary files, and apply reading and writing modes for efficient file manipulation.

We'll cover the following...

The need to move around

Sometimes when reading from or writing to file, we may want to jump to a different location in the file and start reading or writing from there. The fseek function lets us do exactly that. We can give the number of bytes after which the read or write is to take ...