Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

inttypes(3) [netbsd man page]

INTTYPES(3)						   BSD Library Functions Manual 					       INTTYPES(3)

NAME
inttypes -- standard fixed-size integer types SYNOPSIS
#include <inttypes.h> DESCRIPTION
The <inttypes.h> header describes a set of format specifier macros aimed to increase portability both within and across operating systems. It includes the <stdint.h> header and extends it with additional facilities. Each of the following macros expand to a character string literal containing the format specifier suitable for use within the format argument of a formatted I/O function such as printf(3). Each macro contains an identifier (PRI or SCN), a conversion specifier, and a possible length modifier. The length modifier follows the integer types described in stdint(3): int8_t uint8_t int16_t uint16_t int32_t uint32_t int64_t uint64_t int_least8_t uint_least8_t int_least16_t uint_least16_t int_least32_t uint_least32_t int_least64_t uint_least64_t int_fast8_t uint_fast8_t int_fast16_t uint_fast16_t int_fast32_t uint_fast32_t int_fast64_t uint_fast64_t intmax_t uintmax_t intptr_t uintptr_t The following format specifiers are defined for the fprintf(3) and fscanf(3) families, respectively: PRI?8 SCN?8 PRI?16 SCN?16 PRI?32 SCN?32 PRI?64 SCN?64 PRI?LEAST8 SCN?LEAST8 PRI?LEAST16 SCN?LEAST16 PRI?LEAST32 SCN?LEAST32 PRI?LEAST64 SCN?LEAST64 PRI?FAST8 SCN?FAST8 PRI?FAST16 SCN?FAST16 PRI?FAST32 SCN?FAST32 PRI?FAST64 SCN?FAST64 PRI?MAX SCN?MAX PRI?PTR SCN?PTR The available conversion specifiers, ``?'' in above, are d and i for signed integers and o, u, x, and X for unsigned integers. The X is not available for the fscanf(3) family. Without the length modifier these would correspond with %d, %i, %o, %u, %x, and %X, respectively. EXAMPLES
The following example demonstrates typical usage: uint64_t i = 123; ... (void)printf("i = %"PRIu64" ", i); SEE ALSO
printf(3), scanf(3), stdint(3) STANDARDS
The <inttypes.h> header conforms to ISO/IEC 9899:1999 (``ISO C99'') and IEEE Std 1003.1-2001 (``POSIX.1''). HISTORY
The <inttypes.h> header was first introduced in NetBSD 1.6. BSD
March 21, 2010 BSD

Check Out this Related Man Page

STDINT(7)					       BSD Miscellaneous Information Manual						 STDINT(7)

NAME
stdint -- standard integer types SYNOPSIS
#include <stdint.h> DESCRIPTION
The <stdint.h> header provides source-portable integer types of a specific size, smallest memory footprint with a minimum size, fastest access speed with a minimum size, largest integer size, and those capable of storing pointers. 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. 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. 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. 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. 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. 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. 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 avail- able on a specific architecture. 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. Additionally, the <stdint.h> header defines some macros, but none of them are documented here. STANDARDS
The <stdint.h> header conforms to ISO/IEC 9899:1999 (``ISO C99'') and IEEE Std 1003.1-2001 (``POSIX.1''). HISTORY
The <stdint.h> header was first introduced in FreeBSD 5.0. BSD
September 15, 2002 BSD
Man Page