#include<stdio.h>// 函数传数组的参数,需要确定两个参数// 1.数组指针的首地址(数组名);// 2.数组的元素个数;voidforeachArray(int*pArr,intlen){inti;for(i=0;i<len;i++){printf(" %d",pArr[i]);}printf(" \n");}intmain(void){inta[5]={1,2,3,4,5};intb[3]={1,33,77};forea...
//数组做函数参数不传数组个数的遍历方法#include<stdio.h>#include<stdlib.h>#include<string.h>voidPrintfAK(char**pin){inti =0;//关键点:pin[i]!=NULL为终止条件for(i =0; pin[i]!=NULL; i++) { printf("%s\n", pin[i]); } }voidmain(){//赋值数组最后一个元素是0//经过实际检测 NUL...
printf("c[%d] = %d\n", i, c[i]);return0; } 结果: 证明在数组里面[0],[4]可以用来定义某个元素 a[0] =12a[1] =25a[2] =36a[3] =8a[4] =45a[5] =66---b[0] =3b[1] =4b[2] =5b[3] =18b[4] =23b[5] =99---c[0] =36c[1] =0c[2] =0c[3] =0c[4] =82 2...