摘要:
1 //运用strcat函数 2 #include<stdio.h> 3 #include<string.h> 4 int main(){ 5 char s1[100]="Tianjing,",s2[]="How are you"; 6 strcat(s1,s2); 7 puts(s1); 8 re 阅读全文
摘要:
1 //char s1[100],s2[]="How are you!" 2 //s1=s2;错误!因为s1表示数组的第0个元素的地址,它为常量,不能被赋值 3 #include 4 #include 5 int main(){ 6 char s1[100],s2[]="How are you"; 7 strcpy(s1,s2); 8 puts(s1)... 阅读全文
摘要:
1 #include 2 #include 3 int main(){ 4 char s[100]; 5 gets(s); 6 printf("原字符串:%s\n",s); 7 printf("变大写字符串%s\n",strupr(s)); 8 printf("变小写字符串%s\n",strlwr(s)); 9 return ... 阅读全文
摘要:
1 #include 2 #include 3 int main(){ 4 char s1[100]; 5 gets(s1); 6 puts(s1); 7 printf("字符串长度:%d\n",strlen(s1)); 8 return 0; 9 } 阅读全文