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.

About Silver Moon

A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at [email protected].

Leave a Reply

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