본문 바로가기

Toggle 1 to 0 and 9 to 1 using xor

java by 낼스 2014. 11. 28.
{
  static int x = 0;
 
  // Toggles 1 to 0 and 0 to 1 using xor
  x ^= 1;
 
  // Call the method that expects a 1 or 0
  [methodCallHere toggle:x];
}


댓글