本文介绍了问题abt printf在Turboc上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 大家好, 我需要一个关于此代码的帮助 请帮助我 以下代码我在Turboc上工作 我期待的结果与已印刷的结果不同我 表示该行与 / *这一个* /第10行我没想到第一个%ld和第二个%d 的6553,但是它以不同的方式打印我也粘贴打印结果, 它低于代码。 我完全糊涂了,因为我得到了一个答案,这取决于 编译器,但我不是满意。可以任何身体善良的人帮助 我有正确的解释 感谢和问候 / *代码* / 1 int main(无效) 2 { 3 unsigned int un = 3000000000; / *系统具有32位int * / 4短端= 200; / *和16位短* / 5 unsigned int big = 6553; 6 long long verybig = 12345678908642; 7 clrscr( ); 8 printf(un =%u而非%d \ n,un,un); 9 printf(" end =%hd和%d \ n",end,end); 10 printf(big =%ld而不是%d \ n,大,大); / *这一个* / 11 printf(" verybig =%lld而非%ld \ n",verybig,verybig); 12 getch(); 13返回0; 14} 输出低于 un = 24064不是24064 结束= 200和200 big = 429463961而不是996 / *< -why它是996 whynot 6553 * / verybig = 1942899938而不是1942899938 Hello all ,I need a help on this codekindly help me outfor the below code I worked on the Turbocthe result I was expecting was different from what has been printed Ihave indicated the line with " /*this one*/" line no 10I did expected some junk for the first %ld and 6553 for the second %d,but it printed in different way I am also pasting the result printed ,it is below the code .I am totally confused because I got one answer that was it depends oncompiler but I am not satisfied .can any body kind hearted people helpme with proper explanation thanks and regards /*code */ 1 int main(void)2 {3 unsigned int un = 3000000000; /* system with 32-bit int */4 short end = 200; /* and 16-bit short */5 unsigned int big = 6553;6 long long verybig = 12345678908642;7 clrscr();8 printf("un = %u and not %d\n", un, un);9 printf("end = %hd and %d\n", end, end);10 printf("big = %ld and not %d\n", big,big); /*this one */11 printf("verybig= %lld and not %ld\n", verybig, verybig);12 getch();13 return 0;14 }the Output is below un = 24064 and not 24064end = 200 and 200big = 429463961 and not 996 /* <-why it is 996 whynot 6553*/verybig= 1942899938 and not 1942899938 推荐答案 请忽略Eltee。他/她/这是一个新收购的巨魔轮。 - 迈克尔 - 电子邮件:我的是一个gmx点地址。 Please ignore "Eltee". He/she/it is a newly acquired troll round here. - Michael--E-Mail: Mine is a gmx dot de address. 这篇关于问题abt printf在Turboc上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-23 13:38