補充作業
#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;
}
總結:定義一個字符串str,定義一個funstr函數,將小寫轉化為大寫,用%c輸出,最后再用%s輸出一遍

浙公網安備 33010602011771號