INT64_MAX --Constant representing the maximum value of int64_t

INT64_MAX is a constant that represents the maximum value of int64_t --signed 64-bit integer type. It can be used by including the " stdint.h" header. This is the constant macro introduced in C99.

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

int main (void) {
  printf("%lld", INT64_MAX);
}

I am using "%lld" in the format specifier of the printf function. We use "%lld" as the format specifier so that everything works correctly on Unix / Linux / Mac / Windows. This is because "%ld" means a signed 32-bit integer in Windows. "%Lld" is used to guarantee a signed 64-bit integer.

The output INT64_MAX value.

9223372036854775807

Associated Information