Does C have circular shift operators?
No. (Part of the reason why is that the sizes of C’s types aren’t precisely defined–see question 1.2–but a circular shift makes most sense when applied to a word of a particular known size.) You can implement a circular shift using two regular shifts and a bitwise OR: (x << 13) | (x >> 3) /* circular shift left 13 in 16 bits */ comp.lang.c FAQ list · Question 20.21b Q: Is C a great language, or what? Where else could you write something like a+++++b ? A: Well, you can’t meaningfully write it in C, either. The rule for lexical analysis is that at each point during a straightforward left-to-right scan, the longest possible token is determined, without regard to whether the resulting sequence of tokens makes sense. The fragment in the question is therefore interpreted as a ++ ++ + b and cannot be parsed as a valid expression. References: K&R1 Sec. A2 p. 179 K&R2 Sec. A2.1 p. 192 ISO Sec. 6.1 H&S Sec. 2.3 pp. 19-20 comp.lang.c FAQ list · Question 20.22 Q: If the assignment operator were