第1 章 C 语言概述 ···························································································.1
1.1 C 语言产生的背景 ·················································································.1
1.2 C 语言的特点 ·······················································································.2
1.3 C 语言程序的结构 ·················································································.2
1.3.1 C 语言程序的基本单位 ···································································.2
1.3.2 C 语言函数的格式 ·········································································.2
1.3.3 关键字 ·······················································································.4
1.4 C 语言程序的集成开发环境 ·····································································.5
1.4.1 Dev-C++的安装和使用 ···································································.5
1.4.2 Visual C++ 2010 的安装和使用 ·························································.9
实训1 认识C 语言程序 ········································································.16
本章小结 ··································································································.17
习题1 ······································································································.17
第2 章 数据类型、运算符与表达式 ·····································································.19
2.1 C 语言的数据类型 ················································································.19
2.2 常量与变量 ·························································································.20
2.2.1 直接常量和符号常量 ····································································.20
2.2.2 变量 ·························································································.22
2.2.3 常变量 ······················································································.22
2.3 整型数据 ····························································································.23
2.3.1 整型常量 ···················································································.23
2.3.2 整型变量 ···················································································.24
实训2 使用整型数据 ···········································································.27
2.4 实型数据 ····························································································.28
2.4.1 实型常量 ···················································································.28
2.4.2 实型变量 ···················································································.29
实训3 使用实型数据 ···········································································.30
2.5 字符型数据 ·························································································.31
2.5.1 字符常量 ···················································································.31
2.5.2 字符变量 ···················································································.32
2.5.3 字符串常量 ················································································.34
实训4 使用字符型数据 ········································································.35
2.6 算术运算符和算术表达式 ·······································································.36
2.7 赋值运算符和赋值表达式 ·······································································.38
2.8 关系运算符和关系表达式 ·······································································.43
2.9 逻辑运算符与逻辑表达式 ·······································································.44
2.10 逗号运算符和逗号表达式 ·····································································.46
2.11 位运算 ·····························································································.47
2.11.1 位逻辑运算符 ············································································.48
2.11.2 移位运算符 ···············································································.50
2.11.3 位赋值运算符 ············································································.50
2.11.4 不同长度的数据进行位运算 ··························································.51
实训5 使用运算符和表达式 ··································································.51
本章小结 ···············