In java, there are FileChannels where I can read from file channel. I can also set the position in the channel where I want to start reading.
Any similar functions in C++/C?
In java, there are FileChannels where I can read from file channel. I can also set the position in the channel where I want to start reading.
Any similar functions in C++/C?
Please look into C++'s ifstream::seekg()
and ifstream::tellg()
. Also in C: ftell()
and fseek()
functions in <stdio.h>
if you want a solution with C
programming
If you want to read from position X
then you can use fread()
up to the (X-1)
and then reuse fread()
or fgets()
or fgetc()
to read from the position X