uint8_t --Unsigned 8bit integer type

"Uint8_t" is an unsigned 8-bit integer type. It can be used by including the " stdint.h" header. This is the type introduced in C99.

# Unsigned 8-bit integer type
uint8_t

The maximum value of an integer that can be represented by an unsigned 8-bit integer type is "255", and the minimum value is "0".

The maximum value is defined by the macro " UINT8_MAX".

uint8_t sample code

This is a sample code using uint8_t.

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

int main (void) {
  uint8_t num = 255;
  
  printf("%u\n", num);
}

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

Output result.

255

Associated Information