#include
#include
#include
int main()
{
char *str1="hello world!";
char *str2="HELLO WORLD!";
int len=strlen(str1);//求的字符串长度,不包括'\0'在内
printf("len=%d\n",len);
int cmp=strcmp(str1,str2);
printf("cmp=%d\n",cmp);
//str1>str2,返回大于零的值,str1
//int strcmp(char *str1,char * str2,int n),只是可以控制个数,别的和strcmp()一样
char str3[100]="hello world!";
char str4[100]="HELLO WORLD!";
strcat(str3,str4);
printf("str3=%s\n",str3);
//函数将字符串str4 连接到str3的末端,即抹掉str3结尾的'\0',但是str4结尾的'\0'保留并返回指针str3。
//str4应该为const。str3的空间要足以容纳str3和str4,不然会发生溢出错误,此函数不安全
char str5[100]="hello world!";
char str6[100]="H