0

how to compare first byte of 512 block?

char buffer[512];
for (int i = 0; i < 20000000/512; i++)
{
    fread(&buffer, 512, 1, inpt_file);
    if (strcmp(buffer[0],0xff) == 0)
    {
        printf("FF found.\n");
    }

}
1

Without giving away the answer to your specific question, here's a hint.

if( <condition_a> && <condition b>... )

This should get you going.

3
  • How to compare bytes? Jan 2 '16 at 19:58
  • This is correct but i have another question. Jan 2 '16 at 20:04
  • if( array[0] == 0xFF )
    – Cliff B
    Jan 2 '16 at 20:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .