int8_t --Signed 8-bit integer type

"Int8_t" is a signed 8-bit integer type. It can be used by including the " stdint.h" header. This is the type introduced in C99.

# Signed 8-bit integer type
int8_t

The maximum value of an integer that can be represented by a signed 8-bit integer type is "127", and the minimum value is "-128".

The maximum value is " INT8_MAX" and the minimum value is " INT8_MIN". It is defined.

int8_t sample code

This is a sample code using int8_t.

#include <stdio.h>
#include <stdint.h>

int main (void) {
  int8_t num = 5;
  
  printf("%d\n", num);
}

"%D" is used in the format specifier of printf function.

Output result.

Five

Associated Information