I know that the & before a variable is a reference to another variable. What does & mean in an if statement.
Specifically this one: if (token[0] == '(' & token[1] == '\0')
but how would this work in the context of evaluating an if statement. Since if statements evaluate to true or false it seems like the logical 'and' operator should be there instead.
I think that you are trying to say 'AND' operator. Well if you thought that then you wrote it wrong. Try replacing your ampersand with this '&&' two ampersands. And i really think you thought of and, because your ampersand is totally wrong.
Okay i don't care who you wrote that code from. Just add double ampersands. Because the person you got the code from made a tiny mistake or was very high.
Happykiller, we don't know the authors reason for using the bit-wise AND. And for all we know, the bit-wise AND could be intentional, or it could be a simple mistake.
You can use it when your operands have side effects and you need to make sure that all of them are carried out.
You'll get no implicit conversion to bool with &, so using it for that purpose is best avoided.