Quote:Original post by Witchcraven
I have seen that type of thing before, and would swear the laws of logic were breaking down. But I always solved the problem, and it is usually a wierd memory thing. The other thing that has messed me up for a while was doing if(a=1)... instead of if(a==1). Sometimes the double = is just not obvious enough.
One way to avoid (a=1) instead of (a==1) is to put the literal value first, ie (1 ==a). That way the compiler will catch (1=a) for you should you omit the second =.