Checking type sizes in C with macros.

Posted by Seisatsu on Stack Overflow See other posts from Stack Overflow or by Seisatsu
Published on 2011-01-09T05:08:49Z Indexed on 2011/01/09 5:54 UTC
Read the original article Hit count: 217

Filed under:
|
|
|
|

I'm writing a program that needs to have unsigned types with definite sizes. I need a uint8, uint16, uint32, and uint64, and I need them defined in types.h, in a way that they will always be defined correctly regardless of platform.

My question is, how can I check the sizes of different types on each platform using preprocessor macros, so that I can define my custom types correctly in the types.h header?

© Stack Overflow or respective owner

Related posts about c

    Related posts about macros