Names specified here
Name Description Notes Source Availability
INT8_MAX Maximum value of int8_t L ? M <stdint.h> C99 C11
INT8_MIN Minimum value of int8_t L ? M <stdint.h> C99 C11
int8_t Signed integer type of exactly 8 bits L ? T <stdint.h> C99 C11
PRId8 Decimal output conversion specifier for int8_t ? M <inttypes.h> C99 C11
PRIi8 Decimal output conversion specifier for int8_t ? M <inttypes.h> C99 C11
PRIo8 Octal output conversion specifier for uint8_t ? M <inttypes.h> C99 C11
PRIu8 Decimal output conversion specifier for uint8_t ? M <inttypes.h> C99 C11
PRIX8 Hexdecimal output conversion specifier for uint8_t ? M <inttypes.h> C99 C11
PRIx8 Hexdecimal output conversion specifier for uint8_t ? M <inttypes.h> C99 C11
SCNd8 Decimal input conversion specifier for int8_t ? M <inttypes.h> C99 C11
SCNi8 General input conversion specifier for int8_t ? M <inttypes.h> C99 C11
SCNo8 Octal input conversion specifier for uint8_t ? M <inttypes.h> C99 C11
SCNu8 Decimal input conversion specifier for uint8_t ? M <inttypes.h> C99 C11
SCNx8 Hexdecimal input conversion specifier for uint8_t ? M <inttypes.h> C99 C11
UINT8_MAX Maximum value of uint8_t L ? M <stdint.h> C99 C11
uint8_t Unsigned integer type of exactly 8 bits L ? T <stdint.h> C99 C11

uint8_t and int8_t are optional integer types of exactly 8 bits. Both types have no padding, and int8_t uses 2's complement. uint8_t is unsigned, and has the range zero to UINT8_MAX, which is [0, +255]. int8_t is signed, and has the range INT8_MIN to INT8_MAX, which is [−128, +127].

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

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

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

Related types:

Property uint8_t int8_t
Width (bits) 8
Lowest value 0 −128
Highest value +255 +127
printf base 10 "%" PRIu8 "%" PRId8 or "%" PRIi8
base 8 "%" PRIo8
upper-case base 16 "%" PRIX8
lower-case base 16 "%" PRIx8
scanf base 10 "%" SCNu8 "%" SCNd8
base 8 "%" SCNo8
base 16 "%" SCNx8
base 16, 8 or 10 by prefix "%" SCNi8

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