Data type u_int8_t , u_int16_t , u_int32_t on windows

On Linux the header file sys/types.h provides the fixed sized integer data types like these :


On windows the header file stdint.h provides similar ones but with slightly different names , uint8_t etc. So if you are writing cross platform code you can get the same ones on windows as in a manner shown below :

#if defined(_WIN32)

#include <stdint.h>

typedef uint8_t u_int8_t;
typedef uint16_t u_int16_t;
typedef uint32_t u_int32_t;


Now you can use u_int8_t , u_int16_t , u_int32_t on windows as well.

Last Updated On : 9th March 2012

Subscribe to get updates delivered to your inbox

About Silver Moon

Php developer, blogger and Linux enthusiast. He can be reached at [email protected]. Or find him on

Leave a comment