c语言程序设计教学课件第6章2.ppt

* 所谓“文件包含”是指将另外的文件包含到本文件之中。 文件包含命令的一般形式为: #include 文件名 或 #include 文件名 例如: #include stdio.h #include math.h 2、文件包含 * 3、条件编译 略(自学) 6.7 程序举例 自学 * 小 结 掌握变量作用域的概念,掌握局部变量和全局变量的概念; 掌握变量存储类别的概念,掌握静态存储和动态存储的概念; 学会使用#define进行宏定义; 学会使用#include进行文件包含。 * 作 业 P104 三、编程题:3 * 课堂练习 #include stdio.h #define M(x) x+100 int a=1; int fun(int x) { static int b=1; b++; return x+a+b; } main() { int a=2,i; a=M(a); printf(a=%d\n,a); for(i=1;i=3;i++) printf(%d\n,fun(i)); } 写程序结果: 运行结果: a=102 4 6 8 * 3、以下程序的输出结果是______。 #include stdio.h #define FUDGE(y) 2.84+y #defin

文档评论(0)

1亿VIP精品文档

相关文档