Basic and Advance C Question:
Download Job Interview Questions and Answers PDF
Does C have circular shift operators?
Answer:
No. (Part of the reason why is that the sizes of C's types aren't precisely defined----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 */
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 */
Download C Programming Interview Questions And Answers
PDF
Previous Question | Next Question |
Is C a great language, or what? | There seem to be a few missing operators ... |