2012年9月4日

变量地址举例

摘要: 1#include<stdio.h>23voidoutArr(int*pArr,intlen)4{5inti;6pArr[1]=100;//此时pArr[1]等价于*(pArr+1)等价于a[1]等价于*(a+1);78for(i=0;i<len;i++)9printf("%d\n",pArr[i]);1011}1213intmain(void)14{15inta[3]={1,2,3};16outArr(a,3);1718return0;19}20/*21在Vc++6.0中显示的结果是:22================================= 阅读全文

posted @ 2012-09-04 21:15 Your Song 阅读(227) 评论(0) 推荐(0) 编辑

数组指针的赋值与输出问题

摘要: 1#include<stdio.h>23voidf(int*pArr,intlen)4{5inti;67for(i=0;i<len;i++)8printf("%d",*(pArr+i));9printf("\n");101112}//该函数实现对数组中的值的输出。1314intmain(void)15{16inta[5]={1,2,3,4,5};17intb[6]={-1,90,45,35,54,22};18intc[100]={1,31,34,11};1920f(a,5);//a是int*类型21f(b,6);22f(c,100);2 阅读全文

posted @ 2012-09-04 19:01 Your Song 阅读(968) 评论(0) 推荐(0) 编辑

导航