36,const的作用
来源:互联网 发布:php和java哪个好找工作 编辑:程序博客网 时间:2024/04/30 21:49
#include <stdio.h>
/*
const 用来修饰基本数据类型的,使得数据类型的变量成为常量
两种写法:1,写在数据类型的左边;2,写在数据类型的右边
*/
int main(int argc,constchar * argv[]) {
//eg:
const int num =10;
/*
const 对指针的影响
(1)指针的指向能改变,而指向的内存空间的值不可以改变。
const int *p;
int const *p;
(2)指针的指向不可以改变,而指向的内存空间的值能改变。
int * const p;
*/
int count =10;
int count1 = 20;
int *p = &count;//在这句加入关键字,可以验证
*p = 55;//改变指针指向的内存空间中存储的值
p = &count1; //修改指针的指向
return 0;
}
0 0
- 36,const的作用
- const 的作用
- const的作用
- Const的作用
- const的作用
- const的作用
- const的作用
- const 的作用
- const的作用
- const的作用
- Static,Const的作用
- const的作用
- const的作用
- const的作用
- const的作用
- const的作用
- const关键字的作用
- const的作用
- (几个gradle)gradle工程的环境搭建----安装gradle
- AKKA文档(java版)—角色
- Spring Security3 - MVC 整合教程 (初识Spring Security3)
- 用NPOI操作EXCEL-锁定列CreateFreezePane()
- oracle分页sql
- 36,const的作用
- 【HTML5】触摸事件(touchstart、touchmove和touchend)
- 公元2015年11月25日。阴。
- spring mvc jquery 上传
- Android中的Fragment之间如何通信
- 【bzoj3439】Kpm的MC密码 trie树+主席树
- 机器学习概念:最大后验概率估计与最大似然估计 (Maximum posterior probability and maximum likelihood estimation)
- main函数的参数传递
- kettle运行时报错 could not create java virtual machine