指针与数组
来源:互联网 发布:nodejs解析json.parse 编辑:程序博客网 时间:2024/05/21 07:28
指针的本质是地址,数组的名称就是数组首位元素的地址。
我们称数组名为指针常量,所以对数组int a[]={0,1};来说,对a使用自增运算符a++,是不可以的,而a+是允许的,*(a+1)获得的就是数组第二个元素的值。
a+1代表第二个元素的地址。如果定义int *p=a;此时p就能获得a的作用,此时的p可以做自增运算,p++。
指针变量的取值与自增自减运算:
*p++;先取得p的地址,然后做p=p+1。等价*(p++);
*++p;先对p做p=p+1,然后取得p+1的地址。
++*p;针对*p做++运算,然后对*p做*p=*p+1;++与*具有相同的优先级,从右往左运算
0 0
- 指针:指针与数组
- 指针与指针数组
- 指针数组与数组指针
- 指针数组与数组指针
- 指针数组与数组指针
- 指针数组与数组指针
- 指针数组与数组指针
- 指针数组与数组指针
- 指针数组与数组指针
- 数组指针与指针数组
- 指针数组与数组指针
- 指针数组与数组指针
- 指针数组与数组指针
- 指针数组 与数组指针
- 指针数组与数组指针
- 数组指针与指针数组
- 指针数组与数组指针
- 指针数组与数组指针
- 第十三章之隐式意图
- SQL Server2005使用CTE实现递归
- Three Gongbaolage Prairie trip (two)
- 常用的MPI函数
- The groom must pay attention to the wedding dress
- 指针与数组
- Fall Shenzhen International Home Textiles Fair Aug
- Beijing 318 second-hand materials recycling compan
- Customs and history of the origin of the Mid-Autum
- 软件工程(四)——生存周期
- South Korean garment industry demands approaching
- Venture breakfast shop open election Which Xi'an s
- 长按POWER键, 一般会弹出关机选择界面, 提示关机或切换模式
- 用C语言实现对N个进程的简单时间片轮转法Round Robin的调度模拟