Inttypes.h

From Wikipedia, the free encyclopedia

The correct title of this article is inttypes.h. The initial letter is shown capitalized due to technical restrictions.
C++ Standard Library headers
C Standard Library headers
assert.h
complex.h
ctype.h
errno.h
fenv.h
float.h
inttypes.h
iso646.h
limits.h
locale.h
math.h
setjmp.h
signal.h
stdarg.h
stdbool.h
stddef.h
stdint.h
stdio.h
stdlib.h
string.h
tgmath.h
time.h
wchar.h
wctype.h

The inttypes.h file is a C header file that is part of the C standard library and API. It defines integral types whose sizes are specific and guaranteed. The behavior of the signed and unsigned modifiers upon these types is undefined; use like-size or widening casts within these types instead.

Integral types defined by inttypes.h
Specifier Common Equivalent Signing Bits Bytes Minimum Value Maximum Value
int8_t char Signed 8 1 −128 127
uint8_t unsigned char Unsigned 8 1 0 255
int16_t short Signed 16 2 −32,768 32,767
uint16_t unsigned short Unsigned 16 2 0 65,535
int32_t long Signed 32 4 −2,147,483,648 2,147,483,647
uint32_t unsigned long Unsigned 32 4 0 4,294,967,295
int64_t long long Signed 64 8 −9,223,372,036,854,775,808 9,223,372,036,854,775,807
uint64_t unsigned long long Unsigned 64 8 0 18,446,744,073,709,551,615

[edit] See also

[edit] Downloads

As inttypes.h is currently NOT shipped with Visual Studio C++ products, you may want to use some external one.

  • inttypes.h - This inttypes.h may be used with Microsoft compilers only. Depends on stdint.h. Tested with Microsoft Visual Studio .NET 2003 and Microsoft Visual Studio .NET 2005.