I've messed up bigtime here somewhere. First of all, here's the code:
if(p->next->t.gid == PARSE_GLUE)
printf("I am rubber, you are glue\n");
if(p->next->t.tid == OPEN_BRACKET)
printf("indeed, it is magical\n");
else if(p->next->t.tid == CLOSE_BRACKET)
printf("AAAAGGGGHH MONKEY CRAP\n");
printf("no it is not\n");
while(p->next->t.gid != PARSE_GLUE && p->next->t.tid != CLOSE_BRACKET)
printf("THE ANSWER IS YES\n");
I am rubber, you are glue
indeed, it is magical
not it is not
- I have to ask, where have I screwed up?
while the first condition of the while loop is false, isn't the second true so both are ok? I mean, if one moment p->next->t.tid == OPEN_BRACKET and then the next it equals CLOSE_BRACKET, then what are things coming too? I have similar while loops in other places that behave perfectly... so what have I done wrong?