In C on a 32-bit system, which data type will store (and can therefore print) the largest integer? Is it long long
or unsigned long
? Is there an unsigned long long
? And which is the most precise and politically correct?
Your question is a bit unclear, but intmax_t
is the largest signed integer-valued type (and uintmax_t
is the largest unsigned integer type). These are typedefs defined in <stdint.h>
, but if you are printing them, you need <inttypes.h>
instead, and the PRInMAX macros for various values of n.