C++ and D bool compatibility

bearophile bearophileHUGS at lycos.com
Thu May 2 18:03:38 PDT 2013


Jeremy DeHaan:

> D bools are 1 byte, and C/C++ chars are 1 byte as well and it 
> works.

D bools are 1 byte, but C chars don't need to be 1 byte, so you 
are working with an implementation detail.

I think in C99+ it's better to use uint8_t from stdint.h, that's 
safely always 1 byte long.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list