Does anyone know why this doesn't work:
#define x 5;
...
if(state == x){... }
Does anyone know why I can't do the above comparison?
Yes, someone do have ideas about your problems.
By the way - is it just your compare that fails? You don't happen to get a compilation error? Have you tried pen and paper and replaced the "x" with "5;"?
I think I wasn't clear. I am getting a compile error. If I replace the x with an actual number, the code compiles correctly.
Are you sure you understand what a define does? Hint: drop the semicolon.