6
如何在C中打印int64_t类型
C99标准具有整数类型,其字节大小如int64_t。我正在使用以下代码: #include <stdio.h> #include <stdint.h> int64_t my_int = 999999999999999999; printf("This is my_int: %I64d\n", my_int); 我收到此编译器警告: warning: format ‘%I64d’ expects type ‘int’, but argument 2 has type ‘int64_t’ 我尝试了: printf("This is my_int: %lld\n", my_int); // long long decimal 但是我得到同样的警告。我正在使用此编译器: ~/dev/c$ cc -v Using built-in specs. Target: i686-apple-darwin10 Configured with: /var/tmp/gcc/gcc-5664~89/src/configure --disable-checking …