https://github.com/objarni/bitmask
A header only library for expressing bitmasks readably in C/C++ pre C++14
https://github.com/objarni/bitmask
Last synced: 8 months ago
JSON representation
A header only library for expressing bitmasks readably in C/C++ pre C++14
- Host: GitHub
- URL: https://github.com/objarni/bitmask
- Owner: objarni
- License: mit
- Created: 2021-11-10T20:52:50.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-10T21:01:53.000Z (over 4 years ago)
- Last Synced: 2025-02-06T11:55:22.968Z (over 1 year ago)
- Language: C
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bitmask
A header only library for expressing bitmasks readably in C/C++ pre C++14
# How to use?
```
#include
#include "bitmask.h"
int main() {
printf("We can now write bitmasks in C easily, no need for C++14 envy. :)\n");
unsigned int value1 = b("1111'1111'1111'1101");
unsigned int value2 = 0xFFFD;
printf("value1 and value2 have same value: %d == %d\n", value1, value2);
}
```