Interfacing with c and platform dependent sizes

bearophile bearophileHUGS at lycos.com
Fri Feb 25 17:06:04 PST 2011


simendsjo:

> So.. A long in C is the same as the platform size? And long long doesn't 
> exist in 64 bit?

In D the size of int/uint is 32 bits and long/ulong is 64 bits.

In C the size of int, unsigned int, long, long long int, unsigned long long int, etc are not fixed, the change according to the CPU. sizeof(int) <= sizeof(long) <= sizeof(long long).

A help:
http://www.digitalmars.com/d/2.0/phobos/std_stdint.html

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list