课上程序的补充

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
char funstr(char str[])
{
    int j,t;
    t=strlen(str);
    for(j=0;j<t;j++)
    printf("%c",str[j]);
    printf("\n%s",str);
    
 
     
}
main()
{
    char str[]="hello world";
    str[0]='H';
    str[6]='W';
    funstr(str);
    system ("pause");
    
}

 

 

 

Hello World
Hello World请按任意键继续. . .

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

  

 

总结:上学期的函数调用没学明白,导致现在在课上很耽误时间,老师给的时间已经很充足,但是自己英语又不好,看不懂错误原因,(即使上百度去查原因了,但是根本没有和我一样的问题,都是类似的。我觉得看百度的更耽误时间。就问了室友原因是什么。课上和室友的努力下,成功的做了出来。主要问题还是在函数调用那。回寝室以后,我把书上函数调用那好好的看了看,最起码下次在这个问题上不会耽误太久。

posted on 2017-03-31 19:21  米粒呀  阅读(102)  评论(0编辑  收藏  举报

导航