Names specified here
Name Description Notes Source Availability
INT16_MAX Maximum value of int16_t L ? M <stdint.h> C99 C11
INT16_MIN Minimum value of int16_t L ? M <stdint.h> C99 C11
int16_t Signed integer type of exactly 16 bits L ? T <stdint.h> C99 C11
PRId16 Decimal output conversion specifier for int16_t ? M <inttypes.h> C99 C11
PRIi16 Decimal output conversion specifier for int16_t ? M <inttypes.h> C99 C11
PRIo16 Octal output conversion specifier for uint16_t ? M <inttypes.h> C99 C11
PRIu16 Decimal output conversion specifier for uint16_t ? M <inttypes.h> C99 C11
PRIX16 Hexdecimal output conversion specifier for uint16_t ? M <inttypes.h> C99 C11
PRIx16 Hexdecimal output conversion specifier for uint16_t ? M <inttypes.h> C99 C11
SCNd16 Decimal input conversion specifier for int16_t ? M <inttypes.h> C99 C11
SCNi16 General input conversion specifier for int16_t ? M <inttypes.h> C99 C11
SCNo16 Octal input conversion specifier for uint16_t ? M <inttypes.h> C99 C11
SCNu16 Decimal input conversion specifier for uint16_t ? M <inttypes.h> C99 C11
SCNx16 Hexdecimal input conversion specifier for uint16_t ? M <inttypes.h> C99 C11
UINT16_MAX Maximum value of uint16_t L ? M <stdint.h> C99 C11
uint16_t Unsigned integer type of exactly 16 bits L ? T <stdint.h> C99 C11

uint16_t and int16_t are optional integer types of exactly 16 bits. Both types have no padding, and int16_t uses 2's complement. uint16_t is unsigned, and has the range zero to UINT16_MAX, which is [0, +65535]. int16_t is signed, and has the range INT16_MIN to INT16_MAX, which is [−32768, +32767].

The following macros can be used in the fmt argument of printf to print arguments of types uint16_t and int16_t:

The following macros can be used in the fmt argument of scanf to scan arguments of types uint16_t * and int16_t *:

The existence of macros such as PRIu16 can be used to detect the existence of uint16_t with conditional compilation.

Related types:

Property uint16_t int16_t
Width (bits) 16
Lowest value 0 −32768
Highest value +65535 +32767
printf base 10 "%" PRIu16 "%" PRId16 or "%" PRIi16
base 8 "%" PRIo16
upper-case base 16 "%" PRIX16
lower-case base 16 "%" PRIx16
scanf base 10 "%" SCNu16 "%" SCNd16
base 8 "%" SCNo16
base 16 "%" SCNx16
base 16, 8 or 10 by prefix "%" SCNi16

CHaR
Sitemap Supported
Site format updated 2024-06-05T22:37:07.391+0000
Data updated 1970-01-01T00:00:00.000+0000
Page updated 2022-06-17T21:43:05.000+0000