最佳答案
#include <stdio.h>
int main() {
unsigned long long int num = 285212672; //FYI: fits in 29 bits
int normalInt = 5;
printf("My number is %d bytes wide and its value is %ul. A normal number is %d.\n", sizeof(num), num, normalInt);
return 0;
}
产出:
My number is 8 bytes wide and its value is 285212672l. A normal number is 0.
我假设这个意想不到的结果是从印刷的 unsigned long long int
。你如何 printf()
一个 unsigned long long int
?