Category: 📂 std/ (C Standard Library)
Header: <iso646.h>
Scope: C95, C99, C11
The iso646.h header defines several macros that expand to alternative spellings for bitwise and logical operators.
| Macro | Equivalent |
|---|---|
| and | && |
| and_eq | &= |
| bitand | & |
| bitor | |
| compl | ~ |
| not | ! |
| not_eq | != |
| or | |
| or_eq | |
| xor | ^ |
| xor_eq | ^= |
These macros are useful in environments where the primary character set does not contain the standard C operators.
Example
#include <iso646.h>
#include <stdio.h>
int main(void) {
if (1 and 1) {
printf("Standard 'and' works!\n");
}
return 0;
}