码迷,mamicode.com
首页 > 其他好文 > 详细

第三次作业

时间:2017-04-04 21:52:41      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:错误   with   return   china   for   成功   ges   git   highlight   

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

int fun(int *p)
{
    printf("%d\n",*p);
}
a[0]=1
a[1]=2
a[2]=3
a[3]=4
a[4]=5
a[5]=6
a[6]=7
a[7]=8
a[8]=9
a[9]=0

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

 总结:在主函数之前声明了fun函数,但在主函数开头忘记声明,导致出现一次错误,修改后编译成功。随着联系增多,编写代码越来越熟练,还需多加练习。

 

 技术分享

 

 

Git地址:http://git.oschina.net/Kakyoin    

     571453471@qq.com

 

第三次作业

标签:错误   with   return   china   for   成功   ges   git   highlight   

原文地址:http://www.cnblogs.com/Kakyoin/p/6666354.html

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