c cprimer plus 第16章 c预处理器和c库
2013-05-18 16:55
260 查看
1.
#define LIMIT 20 const int LIM =50; static int data1[LIMIT];//合法 static int data1[LIM];//无效 const int LIM2= 2 * LIMIT;//合法 const int LIM3= 2 * LIM;//无效 const 定义的是只读变量,不能改变,但不是常量,不能用在数组的下标中(C99支持变长数组);define定义的是常量。 还有常量被编译器放在内存中的只读区域,不能去修改;而“只读变量”放在内存中开辟的一个空间来存放它的值,但是被编译器限定不能修改。 c++中,static int data1[LIM]是合法的。
相关文章推荐
- 第16章 C预处理器和C库 16.9 数学库
- 第16章 C预处理器和C库 16.11 诊断库
- 第16章 C预处理器和C库 16.10 通用工具库
- 第16章 C预处理器和C库 16.2 明显常量:#define
- 第16章 C预处理器和C库 16.12 string.h库中的memcpy()、memmove()
- 第16章 C预处理器和C库 16.13 可变参数:stdarg.h
- 第16章 C预处理器和C库 16.4 宏,还是函数
- 第16章 C预处理器和C库 16.3 在#define中使用参数
- 第16章 C预处理器和C库 编程练习
- 第16章 C预处理器和C库 16.5 文件包含: #include
- 第16章 C预处理器和C库 16.6 其他指令
- 第16章 C预处理器和C库 16.8 C库
- c primer plus第16章总结:C预处理器和C库
- 第16章 C预处理器和C库 16.1 翻译程序的第一步
- 第16章 C预处理器和C库 16.7 内联函数
- Snort 预处理器 ——portscan
- 第16章 PHP正则表达式应用
- 预处理器 (2)
- how tomcat works(第16章: 关闭钩子)
- 鸟哥,netbeans,j2me,预编译,预处理器