View Single Post
  #3   (View Single Post)  
Old 18th November 2008
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

My copy of K&R says (page 49) that ++ has higher precidence than % .

And now for something completely different way to skin the fish:

variable1 = 3 - variable1;

should toggle nicely between 1 and 2 (;.
Reply With Quote