Page 1 of 1

[C] u_int vs u_int32_t

Posted: Tue Jun 15, 2010 4:51 am
by narke
Hello,

There are two type definition include files <sys/types.h> (u_int, u_char, u_long) and <stdint.h> (u_int8_t, u_int16_t, u_int32_t...).

What are the differencies between these two? Is it important to make a difference between u_int (32 bits) and u_int32_t which is 32 bits also?

Thanks.

Re: [C] u_int vs u_int32_t

Posted: Tue Jun 15, 2010 5:00 am
by Combuster
The former is not defined as a specific width, while the latter is courtesy of the C99 standard. That means that all correct (cough msvc) implementations support the latter, while the former may differ in implementation and may not be present at all on non-posix systems.

Re: [C] u_int vs u_int32_t

Posted: Tue Jun 15, 2010 5:09 am
by narke
That's clear now, thank you.