2014年12月21日

【c语言】利用指针进行两个数的交换。

摘要: #includevoid swap(int *a,int *b){ int temp; temp=*a; *a=*b; *b=temp;}void main(){ int a,b,*m,*n; a=4; b=5; m=&a; n=&b; printf("a=%d,b=%d\n",a,b); swap... 阅读全文

posted @ 2014-12-21 22:16 蜘蛛牛牛 阅读(1576) 评论(0) 推荐(0) 编辑

【c语言】使用NULL和指针来寻找数组中是否存在指定的数字

摘要: #include#includevoid main(){ int a[5],i,*p; int x=10; srand(time()); printf("input data to array:\n"); for(i=0;i<5;i++){ a[i]=rand()%100; printf("%-... 阅读全文

posted @ 2014-12-21 21:57 蜘蛛牛牛 阅读(473) 评论(0) 推荐(0) 编辑

导航