Reputation: 3574
The spec is obviously vague to the point of being almost useless, but my understanding is that in practice the integer types are always as follows:
int
- 16 bit on ancient 16 bit systems, otherwise always 32 bits even on 64 bit architectureslong
- always 32 bitslong long
- always 64 bitssize_t
- 32 bit on 32 bit systems, 64 bits on 64 bit systems (unsigned)Is that table really correct? Are there any significant implementations that violate it?
Updated Table based on responses below
int
- 16 bit on ancient 16 bit systems, otherwise always 32 bits even on 64 bit architectureslong
- may be 32 or 64 bit on 64 bit systems. (Windows 32, *nix usually 64)long long
- always 64 bitssize_t
- 32 bit on 32 bit systems, 64 bits on 64 bit systems (unsigned)Upvotes: 0
Views: 92
Reputation: 1448
long - always 32 bits
That's wrong assumption. There are platforms with 64-bit long
I think you can begin from here
Upvotes: 2