作者:KNN | 来源:互联网 | 2023-05-18 17:07
http://blog.csdn.net/men_wen/article/details/52694069
第一个:
![](https://img.php1.cn/3cd4a/1eebe/cd5/1e3db12dd78db092.webp)
![](https://img.php1.cn/3cd4a/1eebe/cd5/1e3db12dd78db092.webp)
数组指针的小实验
用指针传递参数
结果:
![](https://img.php1.cn/3cd4a/1eebe/cd5/2fdc212433a29829.png)
第二个:
数组指针实验
![](https://img.php1.cn/3cd4a/1eebe/cd5/e62700fe09f8933e.webp)
定义一个指针 他指向数组
![](https://img.php1.cn/3cd4a/1eebe/cd5/b386c433a16f5497.webp)
把上面的测试函数中的参数传递部分换成这样
换了之后
实参传入部分会报错
必须加上取地址符号&
![](https://img.php1.cn/3cd4a/1eebe/cd5/70be2ca197098d98.webp)
第三种
形参: 定义一个数组 里面全是指针
![](https://img.php1.cn/3cd4a/1eebe/cd5/d942b7ec373849c3.webp)
![](https://img.php1.cn/3cd4a/1eebe/cd5/6789f68dabde0aed.png)
![](https://img.php1.cn/3cd4a/1eebe/cd5/7d7ef3f69d479716.webp)
![](https://img.php1.cn/3cd4a/1eebe/cd5/8373b1277127c518.webp)
最稳妥的在KEIL-C下 传递数组参数的方式如下:
![](https://img.php1.cn/3cd4a/1eebe/cd5/1e3db12dd78db092.webp)
![](https://img.php1.cn/3cd4a/1eebe/cd5/1e3db12dd78db092.webp)
数组指针的小实验
用指针传递参数
结果:
![](https://img.php1.cn/3cd4a/1eebe/cd5/2fdc212433a29829.png)