程序清单3.4print2示例程序
程序清单3.4print2.c程序
/* print2.c--更多printf()的特性 * /
include
int main(void)
{
unsigned int un = 3000000000;/* int为32位和short为16位的系统 */
short end = 200;
long big = 65537;
long long verybig = 12345678908642;
printf("un = %u and not %d\n", un, un);
printf("end = %hd and %d\n", end, end);
printf("big = %ld and not %hd\n", big, big);
printf("verybig= %lld and not %ld\n", verybig, verybig);
return 0;
}
在特定系统中输出结果为(不同的系统可能输出结果不同):
un = 3000000000 and not -1294967296
end = 200 and 200
big = 65537 and not 1
verybig= 12345678908642 and not 1942899938

浙公网安备 33010602011771号