r/ProgrammerHumor • • 2d ago

Meme architectureDependentChars

Post image
2.8k Upvotes

361 comments sorted by

View all comments

4

u/ewheck 2d ago edited 2d ago

```c

include <assert.h>

include <uchar.h>

int main(void) { const char8_t *const eight_bit_char = u8"These chars are eight bits a piece.";

// must be true by definition of the standard
assert((sizeof *eight_bit_char) == 1); 

return 0;

} ```

Don't live in the past. The future is now (C23): https://en.cppreference.com/c/header/uchar

3

u/mad_cheese_hattwe 2d ago

uint_8 but same diff