# **[](https://en.cppreference.com/w/c/header/stdbit)** provides standard bit manipulation (C23): `stdc_popcount` (population count), `stdc_leading_zeros`, `stdc_trailing_zeros`, `stdc_rotl`, `stdc_rotr`. Previously you needed GCC builtins or platform-specific code. Use it for portable bit operations without compiler-specific extensions. ## Example This example demonstrates bit counting and rotation on integers. ```c // compile: gcc -std=c2x -o stdbitexample stdbitexample.c // run: ./stdbitexample // description: bit manipulation functions #include #include int main() { unsigned int x = 0b11010011; printf("popcount(0b11010011) = %u\n", stdc_popcount(x)); printf("leading zeros = %u\n", stdc_leading_zeros(x)); printf("trailing zeros = %u\n", stdc_trailing_zeros(x)); printf("rotl(x, 2) = 0x%x\n", stdc_rotl(x, 2)); return 0; } ```