C语言第二章数据类型1概要.ppt

C语言第二章数据类型1概要

第二章 数据类型、运算符 与表达式 主讲: 刘成山 副教授 E-mail: csliu13@163.com QQ: 1072034680 主要内容 §2.1 标识符 §2.2 数据类型 §2.3 常量 §2.4 变量 §2.5 运算符 §2.6 表达式 §2.1 标识符 变量名、数组名、函数名、标号、用户自定义 字母、数字、下划线的组合(52+10+1) 以字母、下划线开头 一般有长度要求 student_name 、 student_number = stu_name 、 stu_num 大小写有区别 见名知意 标识符 007 YesIcan! a1b2c3 super-star my_lovely_kitty `99 1,000,000pounds £1000000 c.s.liu _sum # 47_207 maks no1 my pc 关键字 保留 ANSI 32个 (附录C) 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 关键字 inline, restrict, _bool, _Complex, _Imaginary 12个编译预处理命令 define, elif, else, endif, error, if, ifdef, ifndef, include, line, progma, undef ()、 、“ ”、(空格) int a; inta ? min(int x,int y) ? §2.2 数据类型 字符型 char 基本类型 整型 int 单精度 float 实型(浮点型) 双精度 double 数组型 (array) 数据类型 结构体型 (含位段) struct 构造类型 共用体型 union 枚举型 enum 自定义型 typedef 指针类型 (pointer) 空类型 void 基本类型 关键字 char 8 bits ASCII码 –128 ~ 127 int 16 –32768 ~ 32767 float 32 3.4× 10–38 ~ 3.4 × 1038 (±) double 64 1.7 × 10–308 ~ 1.7 × 10308 (±) 类型修饰符 signed 、 unsigned long 、 short (通常只修饰 int 和 char ) 基本类型 ( signed ) char 8 bits –128 ~ 127 unsigned char 8 0 ~ 255 ( signed ) int 16 –32768

文档评论(0)

1亿VIP精品文档

相关文档