CHARACTER SET IDENTIFIERS AND KEYWORDS 关键字 Keywords L Keywords The following identifiers are reserved for use as keywords, and may not be used as ordinary identifiers auto break case char const continue default do double else enum extern f1。at for goto if int long register return short signed sizeof static struct switch typedef un。n unsigned void volatile while 第二讲擲粪型、算莓和表达丸「
关键字 Keywords Keywords – The following identifiers are reserved for use as keywords, and may not be used as ordinary identifiers: CHaraCTer seT, iDenTiFiers anD KeYWorDs 第二讲 数据类型、运算符和表达式 目 录 auto break case char const continue default do double else enum extern float for goto if int long register return short signed sizeof static struct switch typedef union unsigned void volatile while
VARⅠ ABLES 变量 Variables 口变量( Variables) 变量是在程序执行过程中其值会发生变化的量。 Variables are program elements that change their values during the course of program execution 口声明( Declaration) <type name> <variable name>L<variable name>L-.J] 变量在使用之前必须被声明。 变量可以在声明 int x y i 时被初始化 变量类型 (initialized) in七 sumO (type) float)(volt char)(degree) 变量名(name) 是一个标识符 第二讲擲粪型、算莓和表达丸「
变量 Variables 变量(Variables) – 变量是在程序执行过程中其值会发生变化的量。 – Variables are program elements that change their values during the course of program execution. 声明(Declaration) <type_name> <variable_name>[,<variable_name>[,...]] 变量在使用之前必须被声明。 VariaBLes 第二讲 数据类型、运算符和表达式 目 录 int x , y ; int sum=0 ; float volt ; char degree ; 变量名(name) 是一个标识符 变量类型 (type) 变量可以在声明 时被初始化 (initialized)
VARⅠ ABLES 变量与内存 Variables and Memory 变量与内存( Variables and Memory) 每一个变量有名字(name),类型(type),大小(size)和值( value) 变量名对应于它在内存中的位置( location) 当一个新的值被放进( placed into)变量时,它将替换( replace)掉以前的值 从内存中读取变量的值不会改变它 L A visual representation int x= 23 RAM =90; FF02 90 2Bytes printf( d",x)i 第二讲擲粪型、算莓和表达丸「
变量与内存 Variables and Memory 变量与内存(Variables and Memory) – 每一个变量有名字(name),类型(type),大小(size)和值(value) – 变量名对应于它在内存中的位置(location) – 当一个新的值被放进(placed into)变量时,它将替换(replace)掉以前的值 – 从内存中读取变量的值不会改变它 A visual representation VariaBLes 第二讲 数据类型、运算符和表达式 目 录 int x = 23; 23 FF02 2Bytes RAM x = 90; 90 printf(“%d”, x);
VARⅠ ABLES 变量初始化 ariables nitia iation 日 initialization A variable may be initialized in its declaration. char esc=\′; Initializer int i =0 limit MAXLINE+1 float eps =1.0e-5; t If the variable in question is not automatic, the initialization is done once only, conceptually before the program starts executing, and the initializer must be a constant expression t Automatic variables for which there is no explicit initializer have undefined values 第二讲擲粪型、算莓和表达丸「
变量初始化 Variables Initialization Initialization – A variable may be initialized in its declaration. If the variable in question is not automatic, the initialization is done once only, conceptually before the program starts executing, and the initializer must be a constant expression. Automatic variables for which there is no explicit initializer have undefined values. VariaBLes 第二讲 数据类型、运算符和表达式 目 录 char esc = ‘\\’; int i = 0, limit = MAXLINE+1; float eps = 1.0e-5; Initializer
DATA TYPES 教据粪型 Data Types 口C语言的数据类型 基本类型 整型( integer):int, short,long 字符型( character):char 浮点型( floating- point): float., double 枚举类型( enumeration):enum 构造型 结构体( structure): struct 共用体( union): union 数组(aray) 指针类型( pointer) 空类型(void):woid 第二讲擲粪型、算莓和表达丸「
数据类型 Data Types C 语言的数据类型 – 基本类型 • 整型(integer):int, short, long • 字符型(character):char • 浮点型(floating-point):float, double • 枚举类型(enumeration):enum – 构造型 • 结构体(structure):struct • 共用体(union):union • 数组(array) – 指针类型(pointer) – 空类型(void):void DaTa TYPes 第二讲 数据类型、运算符和表达式 目 录