首页 > 其他 > 详细

课上作业

时间:2017-03-31 19:10:19      阅读:147      评论:0      收藏:0      [点我收藏+]
#include<stdio.h>
int main()
{    void funstr(char str[12]);
     char str[12]={"hello world"};
     char *a=str;
     str[0]=H;
     str[6]=W; 
     funstr(a);
     return 0;
} 
void funstr(char str[12])
{
    int t=0;
    printf("%s\n",str);
    while(str[t]!=\0)
    {
        printf("%c\n",str[t]);
        t++;
    }
}
Hello World
H
e
l
l
o

W
o
r
l
d
请按任意键继续. . .

总结:为何课上没有做出来:因为课上的代码子函数无法运行,一直不会子函数的调用,所以一节课都没做出来。课下,我问了我舍友,如何对子函数调用,并且他教我编译了这个代码的子函数。

对此,我认为自己以后多加练习对子函数的调用,来增强对c语言的学习。

课上作业

原文:http://www.cnblogs.com/feng248631450/p/6652689.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!