STDINT(7)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

✨ 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