课堂补充
#include<stdio.h> #include<conio.h> int main(void) { void funstr(char a[],int c); char str[20]="hello world"; str[0]='H'; str[6]='W'; funstr(str,sizeof(str)); return 0; } void funstr(char a[],int c) { int b; printf("%s\n",a); for(b=0;b<c;b++) { printf("%c",a[b]);
} }
总结:上课的时候没有调用函数,贼瓜皮,询问完老师,老师告诉我了 ,然后心跳崩了,对C不抱有希望,然后课下反省 还是写出来了 不过问了室友,美滋滋 666,我是真皮,编译的时候 出错的是第九行,还有少加空格