How to Declare a 32-bit Integer in C

ZZ Coder picture ZZ Coder · Aug 4, 2009 · Viewed 98.2k times · Source

What's the best way to declare an integer type which is always 4 byte on any platforms? I don't worry about certain device or old machines which has 16-bit int.

Answer

Corey D picture Corey D · Aug 4, 2009
#include <stdint.h>

int32_t my_32bit_int;