码迷,mamicode.com
首页 > 编程语言 > 详细

C语言第三次作业

时间:2017-04-04 21:50:30      阅读:224      评论:0      收藏:0      [点我收藏+]

标签:[1]   div   pre   logs   ima   after   ted   color   ges   

 

 #include<stdio.h>
 #include<conio.h>
 
 int fun(int *p)
 {
     printf("%d\n",*p);
 }
 main() 
 {
     int fun(int *p);
     int a[10]={1,3,6,5,63,6,3,7,4,9};
     int *q;
     for(int i=0;i<10;i++)
     {    q=&a[i];
         printf("a[%d]=",i);
         fun(q);
     }
     getch();
     
 }

运行结果:

a[0]=1
a[1]=3
a[2]=6
a[3]=5
a[4]=63
a[5]=6
a[6]=3
a[7]=7
a[8]=4
a[9]=9

--------------------------------
Process exited after 30.28 seconds with return value 0
请按任意键继续. . .

技术分享

技术分享总结:在for里定义int i,保存到c会出错要把int拿出来

C语言第三次作业

标签:[1]   div   pre   logs   ima   after   ted   color   ges   

原文地址:http://www.cnblogs.com/lemonfk/p/6666369.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!