课堂作业补充
#include<stdio.h> int main() { void funstr(char str[12]); char str[12]={"hello world"}; char *i=str; str[0]='H'; funstr(i); return 0; } void funstr(char str[12]) { int t=0; printf("%s\n",str); while(str[t]!='\0') { printf("%c",str[t]); t++; } }
Hello world Hello world -------------------------------- Process exited after 0.5695 seconds with return value 0 请按任意键继续. . .