补充

#include<stdio.h>
int main()
{
	char str[]="hello world";
	printf("%s\n",str);
	funstr(str);
	return 0;
}
int funstr(char str[])
{
	int i=0;
	str[0]='H'; 
    str[6]='W';
	while(str[i]!='\0')
	{
		printf("%c",str[i]);
		i++;
	}
}

  

hello world
Hello World
--------------------------------
Process exited after 0.3634 seconds with return value 0
请按任意键继续. . .

总结:

在课上更改字母大小写不会,定义函数funstr也不会,问题很多,课下通过问室友和参考教材总结出这个代码。

 

posted @ 2017-03-31 18:05  圣星  阅读(101)  评论(0编辑  收藏  举报