扩展为以下形式: 表达式1,表达式2,…表达式n 整个逗号表达式的值等于表达式n的值。
2.程序中使用逗号表达式,通常是要分别求逗号表达式内各表达式的值,并不一定要求整个逗号表达式的值。
3.并不是在所有出现逗号的地方都组成逗号表达式,如在变量说明中,函数参数表中逗号只是用作各变量之间的间隔符。
[Practice] //arithmeticint a,b,c;
float d;
a=11;
b=235;
c=a+b-a*b;
d=(float)c/(float)a;
a=c/a;'Vtable
a,2,0
b,2,0
c,2,0
d,4,0.0
of Vtable
'Vupdate
1,0;2,0;3,0
4,0.0
1,11
2,235
3,-2339
4,-212.636368
1,-212
of Vupdate
of Practice
[Practice] //1int a,b,c1,c2;
a=25;
b=3243;
c1=b/a;
c2=b%a;'Vtable
a,2,0
b,2,0
c1,2,0
c2,2,0
of Vtable
'Vupdate
1,0;2,0;3,0;4,0
1,25
2,3243
3,129
4,18
of Vupdate
of Practice
[Practice] //1int a,b,c;
a=25;
b=40;
c=a+b,c+35;'Vtable
a,2,0
b,2,0
c,2,0
of Vtable
'Vupdate
1,0;2,0;3,0
1,25
2,40
3,65
of Vupdate
of Practice
小结
1.C的数据类型
基本类型,构造类型,指针类型,空类型
2.基本类型的分类及特点
类型说明符 字节 数值范围
字符型char 1 C字符集
基本整型int 2 -32768~32767
短整型short int 2 -32768~32767
长整型 long int 4 -214783648~214783647
无符号型 unsigned 2 0~65535
无符号长整型 unsigned long 4 0~4294967295
单精度实型 float 4 3/4E-38~3/4E+38
双精度实型 double 8 1/7E-308~1/7E+30 |