0

fread(&quad, sizeof(FIRSTFOUR), 1, inptr); so I get the first four bytes (FIRSTFOUR is a struct with four BYTES defined first, second, third, fourth) but how do I compare quad.first to oxff, etc???? strncmp compares strings, == does not seem to work. Do I have to get it into a variable first? char variable_first = quad.first then compare?? seems wrong.

1
  • 1
    What does "doesn't seem to work" mean exactly? The one and only real way to compare two values in two variables is ==. I'm not sure also which one is your struct: FIRSTFOUR or quad? – Irene Feb 6 '16 at 2:22
2

GOT IT! you need to format - if comparing hex, need to say 0x34 not 34.

1
  • 1
    please accept your own answer so this can be marked as solved. thanks. – curiouskiwi Feb 10 '16 at 7:34

You must log in to answer this question.

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