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 Answer 1

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? Commented Jan 2, 2016 at 19:58
  • This is correct but i have another question. Commented Jan 2, 2016 at 20:04
  • if( array[0] == 0xFF )
    – Cliff B
    Commented Jan 2, 2016 at 20:11

You must log in to answer this question.

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