STDINT(7)
β¨ STDINT π
okay bestie, so this is a page from the Miscellaneous Information Manual β that's the manual name, and honestly it's giving "miscellaneous but make it iconic" π
β and today we're talking about <stdint.h>, the header that literally hands you integers in every shape and size. no cap, it's a whole wardrobe of ints. π
πΈ NAME πΈ
stdint β standard integer types. yes queen, the standard ones. the ones with a specific size. slay.
π¦ SYNOPSIS π¦
#include <stdint.h>
that's it. that's the whole synopsis. go off, bestie. β¨
π DESCRIPTION π
so the <stdint.h> header is out here providing source-portable integer types β and when I say source-portable I mean it. it's giving:
- a specific size π
- the smallest memory footprint, but with a minimum size π§
- the fastest access speed, but also with a minimum size π₯
- the largest integer size π
- and the ones that can hold a pointer π«Ά
that's the whole vibe check. now let me break each one down because you need to know. π
π the exact-size 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. periodt.
π the speed demons
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 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. main character energy tbh.
π§ the tiny memory icons
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 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. lowkey the most responsible of the group. π
π the big ones
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. they ate and left no crumbs. π₯
π«Ά the pointer holders
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. π
π the mystery macros
additionally, the <stdint.h> header defines some macros, but none of them are documented here. π literally not documented. not me leaving you on read, bestie β that's just what the page says. π
β STANDARDS β
the <stdint.h> header conforms to ISO/IEC 9899:1999 (they call it "ISO C99") and IEEE Std 1003.1-2001 (aka "POSIX.1"). certified, validated, iconic. π
π HISTORY π
the <stdint.h> header was first introduced in FreeBSD 5.0. a legend was born. π
and that's the whole page, bestie π go forth and pick the right int for the job π¦β¨
this little transmission was brought to you by Debian, dated September 15, 2002 β yeah, it's vintage, and it still ate. π π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- 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