STDINT(3)
π stdint(3) β standard integer types π
okay so bestie, welcome to stdint.h, the header that's literally the main character of "i need an integer of exactly this many bits" energy. it's stdint from section 3 of the library functions manual, and we're gonna get into it.
β¨ SYNOPSIS β¨
#include <stdint.h>
that's it. that's the whole vibe check. one include and you're in. π«Ά
πΈ DESCRIPTION πΈ
the <stdint.h> header is giving source-portable integer types of a specific size, plus friends: smallest memory footprint with a minimum size, fastest access speed with a minimum size, largest integer size, and the ones capable of storing pointers. it's a whole little family, ngl. π
π the exact-width girlies
the types int8_t, int16_t, int32_t, and int64_t provide a signed integer type of width 8, 16, 32, or 64 bits, respectively. and the types uint8_t, uint16_t, uint32_t, and uint64_t provide an unsigned integer type of width 8, 16, 32, or 64 bits, respectively.
these integer types should be used when a specific size is required. like, you need exactly 32 bits? this is your girl. no cap. π
π the fast girlies
the types int_fast8_t, int_fast16_t, int_fast32_t, and int_fast64_t provide the fastest signed integer type with a width of at least 8, 16, 32, or 64 bits, respectively. and the types uint_fast8_t, uint_fast16_t, uint_fast32_t, and uint_fast64_t provide the fastest unsigned integer type with a width of at least 8, 16, 32, or 64 bits, respectively.
these types should be used when access speed is paramount, and when a specific size is not required. speed over exactness, periodt. π₯
π¦ the small-footprint girlies
the types int_least8_t, int_least16_t, int_least32_t, and int_least64_t provide the smallest memory footprint signed integer type with a width of at least 8, 16, 32, or 64 bits, respectively. and the types uint_least8_t, uint_least16_t, uint_least32_t, and uint_least64_t provide the smallest memory footprint unsigned integer type with a width of at least 8, 16, 32, or 64 bits, respectively.
these types should be used when memory storage is of concern, and when a specific size is not required. tiny but mighty, we stan. πΈ
π the maxxing girlies
the type intmax_t provides a signed integer type large enough to hold any other signed integer. the type uintmax_t provides an unsigned integer type large enough to hold any other unsigned integer.
these types are generally the largest signed and unsigned integer types available on a specific architecture. absolute units. iconic. π
π§ the pointer girlies
the type intptr_t provides a signed integer type with the ability to hold a pointer to void, that can later be converted back to a pointer to void.
the type uintptr_t provides an unsigned integer type with the ability to hold a pointer to void, that can later be converted back to a pointer to void.
pointer goes in, pointer comes back out, the way that round-trips. πβ¨
π SEE ALSO π
go read those too, iykyk π¦
β STANDARDS β
the <stdint.h> header conforms to ISO/IEC 9899:1999 (βISO C99β) and IEEE Std 1003.1-2001 (βPOSIX.1β). certified official, fr fr. β
π HISTORY π
the <stdint.h> header was first introduced in NetBSD 1.6. a legend from the start, honestly. π
and that's the tea, bestie π this lil page is a Debian joint, dated August 9, 2011, and it lives in section 3 β STDINT(3) β so go forth and pick your integer type with intention. slay. π
β¨π
π¦ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms