is there a way to fread() the same bytes you just had read?
fread(buffer, 512, 1, inptr);
if (header(buffer) == true)
{
//execute these lines
do
{
//execute these lines
}
while (condition);
fseek(inptr, 512, SEEK_SET);
}
I've tried to use fseek()
but it goes start of the file. I want to rewind the fread()
exactly 512 bytes
back. Is this possible? Because do / while
condition finishes when a image header spotted and main program goes back to reading but skips the part I've already read to check the image header, and as a result my program misses that header and skips that image. TIA