Possible Duplicate:
How do you set, clear and toggle a single bit in C?
Can some one help me how to toggle a bit at ith position. One way is to ((n>>i)^1) < < i. Are there any other ways ?
Can some one help me how to toggle a bit at ith position. One way is to ((n>>i)^1) < < i. Are there any other ways ? |
|||||
marked as duplicate by James McNellis, bernie, Mark Elliot, Stephen Canon, Alok Singhal Sep 10 '10 at 1:20This question was marked as an exact duplicate of an existing question. |
|||||
|
|
|||
|
You could do
|
|||||||||
|