Data type u_int8_t , u_int16_t , u_int32_t on windows

By | March 9, 2012

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

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *