- 5
- 0
- 约1.19万字
- 约 73页
- 2021-03-24 发布于福建
- 举报
Types, Operators and Expressions(类型,操作符与表达式);Main Contents-1;Main Contents-2; Made up of variable Names:
(变量名的组成:)
Letter and Digits
the first character must be a letter.The underscore “-” counts as a letter.Upper case and lower case letters are distinct.
(变量名由字母和数字组成,下划线被看成是字
母,大小写字母代表不同的变量名 )
; total, sum gz_1, name , _pl,d3
#ab 3d my.d name-1
main()
{ int p1=3;
printf(“%d\n”,P1);
} ;At least the first 31 characters of an internal name are significant.
(内部变量名至少前31个字符是有效的)。
For function names and external variables,
the number may be less than 31.
(对于函数名与外部变量名,字符的数目可以小于31个)
For external names, ANSI C standard
guarantee uniqueness only for 6
characters and the single case.
(对外部变量名,仅对前6个字符而言并不区分大小写);Keyword: (关键字):
if, else, int, float,ect.
They must be in lower case.
(关键字,如 if, else,…等必须是小写字母)
We tend To use short names for local variables (loop indices),and longer
names for external variables.
(我们倾向于局部变量使用较短的名字(如循环变量)
,而外部变量使用较长的名字。;2.2 Data Types and Sizes(数据类型与大小);float: single-precision floating point.
(单精度浮点数)
double: double-precision floating point.
( 双精度浮点数)
In addition, short and long apply to integers.
short, int, sh; long int coun;
The “int” can be omitted
(此外,还有一些可用于限定这些基本类型的限定符),如长整型和短整型,通常在这种情况下“int”可以省略,通常至少,shor 16位,long 32位,且short 的长度不得长于int,而int对象不得长于long对象)。;long double
(该类型用于指定高精度的浮点数)
symbolic constant
Name of symbolic constant: upper case letter
#difine PAI 3.1416
(符号常量名一般采用大写字母来表示)
limits.h,float.h …
(称为标准头文件,包含了所有这些类型的符
号常量以及机器与编译程序的其他性质,见
附录B);Qualifier signed and unsigned:
Them may be applied to char or any integer.
But printable characters are always positive.
(限制符 signed and unsigned 可用于限定char
或任何整数类型。可打印的字符总是正的)。
unsigned char 取值范围是 0-255
signed char 取值范围是 -128-127
Turbo c 的char 是unsigned char;int (2字节)取值范围是 –32768-32767
unsigned int 取值范围是 0-65535
Notice:
the sizes of floating-point objects
原创力文档

文档评论(0)