int16_t --Signed 16bit integer type

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

# Signed 16bit integer type
int16_t

The maximum value of an integer that can be represented by a signed 16-bit integer type is "32767", and the minimum value is "-32768".

The maximum value is " INT16_MAX" and the minimum value is " INT16_MIN". It is defined.

int16_t sample code

This is a sample code using int16_t.

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

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

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

Output result.

1000

Associated Information