2-4 const 限定符
来源:互联网 发布:如何查mac air數據 编辑:程序博客网 时间:2024/06/14 12:18
2-4 const 限定符
=========================================================
=========================================================
2-4-1 定义const对象
const int bufSize = 512;
定义后不能修改,定义时必须初始化。可以用非常量来初始化,比如函数返回值。
2-4-2 const 对象默认为文件局部变量
(在全局作用域声明的const)不能被其他文件访问。
共享方法:extern//file1.ccextern const int bufSize = fcn();//file2.ccextern const int bufSize;// use it
非const变量默认为extern,访问方法://file1.ccint bufSize = fcn();//file2.ccextern int bufSize;// use it
- 2-4 const 限定符
- 4-2-5 指针和const限定符
- const限定修饰符
- 限定符const
- const限定符
- C++ const限定符
- const限定符
- const限定符
- Const限定修饰符
- 浅谈const限定符
- const 限定符
- Const 限定符
- 关于const限定符
- const 限定符
- C++ const 限定符
- const限定符
- const限定符 全
- const 限定符
- 2-1 ~ 2-2 内置类型和字面值常量
- [Leetcode 66, Easy] Plus One
- 2-3 变量
- Validate Binary Search Tree 检测一个BST是否有效@LeetCode
- 【开发工具】分布式编译-IncrediBuild
- 2-4 const 限定符
- java包命名
- 2-5 引用
- 2-6 & 2-7 typedef & 枚举
- LeetCode题解:Merge 2 Sorted Lists
- 2-8 类类型 & 头文件
- ffdemux_mpegts中时间戳的处理问题
- centos6.4 下设置yum本地源
- 树点击节点导航在数据筛选显示和查看内容