Re: data types
- From: Ian Collins <ian-news@xxxxxxxxxxx>
- Date: Sat, 03 Mar 2007 14:30:01 +1300
Roberto Waltman wrote:
koolj96825@xxxxxxxxx wrote:int16_t would be better, to match the types in <stdint.h>.
... an int could
be 32-bit for PCs.
...but the manual for the compiler I am using says int is
16-bit.
Anyway, now that I need to go back over and look closely at my code,
my question is: is there a way to declare a variable say a 16 bit
unsigned integer in C? Or is declaring it "short" the only specifier
that may work?
For non-C99 compilers, the common, non-portable way of doing it is:
typedef [whatever type is 16 bits in your platform] int16;
typedef [whatever type is 32 bits in your platform] int32;
and so on. Then use int16/32/etc. instead of plain int in your code.
--
Ian Collins.
.
- References:
- data types
- From: koolj96825
- Re: data types
- From: Roberto Waltman
- data types
- Prev by Date: Re: passing structures among functions
- Next by Date: Re: data types
- Previous by thread: Re: data types
- Next by thread: Re: data types
- Index(es):
Relevant Pages
|