课堂作业的补充
#include<stdio.h> int funstr(char str[]) {int i=0; str[0]='H'; str[6]='W'; while(str[i]!='\0') {printf("%c",str[i]); i++; } } int main() {char str[]="hello world"; printf("%s\n",str); funstr(str); return 0; }
以上是在课堂上写的程序
首先 我不知道如何把h 替换成H 运用str ''可以实现
经过查找和敲打代码 体会出了调用函数的方法
最后调用函数 完美替换输出 Hello World