指针与数组
来源:互联网 发布:打架怎么处理法律知询 编辑:程序博客网 时间:2024/05/21 17:09
指针与数组:
/*******************指针与数组**********************///一维数组#include<stdio.h>void change(int *p);void main(){int a[]={1, 2, 3};change(a);for(int i=0; i<3; i++){printf("%d\n", a[i]);}}void change(int *p){int b;b=*p;*p=*(p+1);*(p+1)=b;}
输出:
2
1
3
以上,通过指针可以实现对一维数组的改变。
- 指针:指针与数组
- 指针与指针数组
- 指针数组与数组指针
- 指针数组与数组指针
- 指针数组与数组指针
- 指针数组与数组指针
- 指针数组与数组指针
- 指针数组与数组指针
- 指针数组与数组指针
- 数组指针与指针数组
- 指针数组与数组指针
- 指针数组与数组指针
- 指针数组与数组指针
- 指针数组 与数组指针
- 指针数组与数组指针
- 数组指针与指针数组
- 指针数组与数组指针
- 指针数组与数组指针
- 布林线指标
- C++ STL reserve和resize的区别
- java动态代理
- DIV+CSS基础教程:清除浮动
- 生产者-消费者模式 系列 之二 ReentrantLock, Condition 篇
- 指针与数组
- DevExpress- CheckedListBoxControl DataSource属性存在BUG
- [人月神话]读书笔记2--项目分工&&项目概念完整性
- 揭示win32 api拦截细节
- APCS (ARM 过程调用标准)
- 云风开发笔记(1) 背包系统
- could not execute auto check for display colors suing command /usr/bin/xdpyinfo
- 掷硬币问题
- Response JSON数据返回(备忘)