#include<stdio.h>
#include<stdlib.h> void funstr(char *s) { while(*s!='\0') { printf("%c",*s); s++; } } int main() { char str[]="hello world"; str[0]=str[0]-32; str[6]=str[6]-32; funstr(str); return 0; }
Hello World
--------------------------------
Process exited after 0.1586 seconds with return value 0
请按任意键继续. . .

结论: 1、上节课因为忘记以前的知识,所以一直在查以前的知识,搞得脑子凌乱,没有把funstr函数与主函数连起来。

            2、课下主要补充了以前的知识,并询问了舍友这道题的解答,虽然脑子比较笨,最后还是看了答案,但勉强还是理解了。

            3、主函数设了str数组,把里面的【0】和【6】用ASCII代码换成大写并进入funstr函数;而另外设的funstr函数用定义指针的形式来判断是不是符合输出。

 

posted on 2017-03-31 13:21  啦啦呀咦  阅读(132)  评论(0编辑  收藏  举报