Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
C Programming

Bitwise Operators in C

Manipulate bits with & | ^ ~ <>.

Bitwise Operators in C — a practical guide to C bitwise operators with clear examples you can reuse in real projects.

C Programming Tutorial Series (24/102). Prefer one article? Read the complete C programming tutorial.

Short description

Common in flags, protocols, and low-level code.

Bitwise

unsigned flags = 0;
flags |= 1u << 3;  /* set bit 3 */
flags &= ~(1u << 3); /* clear bit 3 */

Leave a reply

Your email address will not be published. Required fields are marked *