Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22042

Invalid operands to binary

$
0
0

I have a method to check weather a number is even or odd:

   -(BOOL)numberIsEven:(unsigned int *)x {  if (x & 1) {  return TRUE; } else{ return FALSE;  }}

however whenever I compile it I get the error:

Invalid operands to binary %

So it's compiling into assembly as a modulus function and failing, somehow, however if I use a modulus based function (arguably slower) I get the same error!


Viewing all articles
Browse latest Browse all 22042

Trending Articles