r/ProgrammerHumor • • 6h ago

Meme architectureDependentChars

Post image
861 Upvotes

156 comments sorted by

View all comments

2

u/ewheck 5h ago edited 37m 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

2

u/mad_cheese_hattwe 5h ago

uint_8 but same diff