[Y-devel] ucs4 in wchar_t

Alexey Boyko smartly at gala.net
Thu Feb 26 09:20:05 GMT 2004


> On win32, wchar_t is 16 bits,  and on my Linux pc (Debian Unstable) its
> 32 bits
> In C you can't depend on any type that isn't explicit about its size, so
> int32_t for example is ok, but depending on 'long' being 4 bytes is not

No, int32_t always 32 bits! it equals to long, where long is 32 bit.
stdint.h may differ on different platforms.

> :o) I've seen platforms where int and long are the same size :p (why
> have a long type ?)

But I've seen platforms, where int and long have different size.

> In C++ things are a little different, int's depend on the hardware (ie.
> x86 is 32bits), however 'short int' is always 16bits, and 'long int' is
> always 32bits according to this C++ book I have (Core C++ by Victor
> Shtern, page 107 :).

In C++ things are the same.





More information about the Y-devel mailing list









2026 © www.Y-Windows.Org - All Rights Reserved