正在加载图片...
b=ca: vtable a,2,6 2, of vtable Vupdate 1,6;2,19 3,0 4,0 65530 4,-114 1,-101 of vupdate of Practice void maino i ng x, y int a, b, c, d d=y+b printf("c=x+a=d, d=y+b=d\n",c, d) 将main说明为返回void,即不返回任何类型的值 x,y被定义为long型 a,b,c,d被定义为int型 5->x 6- 7->a y+b->d 显示程序运行结果of1ongx,y int a, b, c d: c=x+a 从程序中可以看到:x,y是长整型变量,a,b是基本整型变量。它们之间允许进行运算,运算结果为长 整型。但c,d被定义为基本整型,因此最后结果为基本整型。本例说明,不同类型的量可以参与运算并相互 赋值。其中的类型转换是由编译系统自动完成的。有关类型转换的规则将在以后介绍。b=-a;'Vtable a,2,6 b,2,19 c,2,0 d,2,0 of Vtable 'Vupdate 1,6;2,19 3,0 4,0 3,65530 4,-114 1,-101 2,101 of Vupdate of Practice void main(){ long x,y; int a,b,c,d; x=5; y=6; a=7; b=8; c=x+a; d=y+b; printf("c=x+a=%d,d=y+b=%d\n",c,d); } 将 main 说明为返回 void,即不返回任何类型的值 x,y 被定义为 long 型 a,b,c,d 被定义为 int 型 5->x 6->y 7->a 8->b x+a->c y+b->d 显示程序运行结果 of long x,y; int a,b,c,d; c=x+a; d=y+b; 从程序中可以看到:x, y 是长整型变量,a, b 是基本整型变量。它们之间允许进行运算,运算结果为长 整型。但 c,d 被定义为基本整型,因此最后结果为基本整型。本例说明,不同类型的量可以参与运算并相互 赋值。其中的类型转换是由编译系统自动完成的。有关类型转换的规则将在以后介绍
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有