Size of int in C on different architectures

Posted by NawaMan on Stack Overflow See other posts from Stack Overflow or by NawaMan
Published on 2009-10-23T06:45:07Z Indexed on 2010/05/03 21:08 UTC
Read the original article Hit count: 401

Filed under:
|
|
|

I am aware that the specification of the C language does not dictate the exact size of each integer type (e.g., int).

What I am wondering is: Is there a way in C (not C++) to define an integer type with a specific size that ensures it will be the same across different architectures? Like:

typedef int8 <an integer with 8 bits>
typedef int16 <an integer with 16 bits>

Or any other way that will allow other parts of the program to be compiled on different architecture.

© Stack Overflow or respective owner

Related posts about c

    Related posts about type