const的用法
来源:互联网 发布:阿里数据研究院 编辑:程序博客网 时间:2024/06/07 00:14
用一个实例代码来记录一下使用const定义的变量可以怎样赋值
#include <stdio.h>int main(){ int b = 10; const int a = b; int const c = b; a = 10; //error, con't modify read-only. c = 11; //error, con't modify read-only. const int *e = &b; //*e is const, but e is not read-only. int f = 20; *e=13; //error, con't modify read-only. e= &f; //ok. int * const g = &b; //g is const, but *g is not read-only. *g = 21;//ok g = &f; //error. return 0;}
0 0
- const 的用法
- const关键字的用法
- const的用法说明
- const限定词的用法
- const 的用法
- const的用法【转】
- const的用法小结
- const的用法
- 关于CONST的用法
- const的用法lizi
- const的用法lizi2
- const的用法
- 关于const的用法
- Const的用法
- CONST的用法
- const的用法
- 关于CONST的用法
- 关于CONST的用法
- 英语成长足迹(二)
- 【Android UI设计与开发】第03期:引导界面(三)仿微信引导界面以及动画效果
- ios Masonry做autolayout
- Linux下 JAVA环境 Tomcat+JDK
- Struts2配置错误之The Struts dispatcher cannot be found
- const的用法
- 在数字间填入加号或者减号,使等式成立
- 指纹识别调试记录
- Camel trading - UVa 10700 dp
- R语言学习笔记 .
- onAttachedToWindow()在整个Activity生命周期的位置及使用
- Android中使用addr2line来分析native信息
- Billboard(线段树)
- android代码解析之图片缓存(ImageDownloader)