1.字符串系列函数1strlen:字符串有效长度‘\0’之前char str[]hello; int nstrlen(str);//5 int msizeof(str);//6(\0)(2)strcpystrncpy:拷贝char str1[20]; char str2[]hello; strcpy(str1,str2);//str1为hellochar str1[20]; char str2[]hello; strncpy(str1,str2,3);//只给str1拷贝str2的前三个字符3strcat:连接char str1[20]hello: char str2[20]world; strcat(str1,str2);//str1helloworldchar str1[20]hello: char str2[20]world; str1[2]\0; strcat(str1,str2);//str1heworldchar str1[20]hello: char str2[20]world; strcat(str1,str22);//str1hellorld(4)strcmp:比较(5)strstr:在主串里找子串的位置(6)strtok:字符串分割2.变量1局部变量局部存活局部可见2静态局部变量项目存活变量存活局部可见3全局变量整个项目多个文件都可以使用extern全部变量声明4静态全局变量项目存活变量存活本文件函数可以直接使用5静态函数本文件可以随便调用该函数其他文件不可以链接