I'm currently compiling in Windows XP with Mingw and I'm trying to use %lld and %llu. Here are the code and its output:
Code: Select all
#include <stdio.h>
#include <limits.h>
int main()
{
/* header */
fprintf(stdout, "%22s | %8s | %7s | %4s | %19s | %20s\n", "DATA TYPE", "printf()", "scanf()", "BITS", "MIN", "MAX");
/* long long int */
fprintf(stdout, "%22s | %8s | %7s | %4u | %19lld | %20lld | %8d\n", "long long int", "lld", "lld", sizeof(long long int) * CHAR_BIT, LLONG_MIN, LLONG_MAX);
/* unsigned long long int */
fprintf(stdout, "%22s | %8s | %7s | %4u | %19llu | %20llu | %8d\n", "unsigned long long int", "llu", "llu", sizeof(unsigned long long int) * CHAR_BIT, 0, ULLONG_MAX);
return 0;
}
Code: Select all
DATA TYPE | printf() | scanf() | BITS | MIN | MAX
long long int | lld | lld | 64 | 0 | -2147483648
unsigned long long int | llu | llu | 64 | 0 | 4294967295