logical if in C

Was that what the compiler didn't like?
You never actually posted the error message.
Or your code.