一、strcpy
字符串拷贝函数:strcpy
eg: strcpy(a,"hello");//把hello拷贝到a字符串中
strcpy(a,b)//把b字符串拷贝到a字符串中
![](https://i-blog.csdnimg.cn/blog_migrate/da0e7834c5b3c99753b2dc45f051ae5e.png)
![](https://i-blog.csdnimg.cn/blog_migrate/07b7f0482c2f22c060eb4be62969227f.png)
二、strcat
字符拼接函数: stycat(目的空间需要足够大放入拼接的字符串)
eg: stycat(a,"hello");//把hello拼接到a字符串后
如果a={"hi"};则拼接后为 hihello
![](https://i-blog.csdnimg.cn/blog_migrate/49ae6e55443e43e155b03aa3a182573e.png)
![](https://i-blog.csdnimg.cn/blog_migrate/d62e437f6665e898dc57e41a411c3867.png)
三、strcmp
字符串比较函数: stycmp
eg: x=stycmp(a,b);
当x>0时,则a字符串大于b字符串;
当x<0时,则a字符串小于b字符串;
当x=0时,则a字符串等于b字符串;
![](https://i-blog.csdnimg.cn/blog_migrate/2b7b9ce78d0e94461daf71645aad59d3.png)
![](https://i-blog.csdnimg.cn/blog_migrate/f51952084759aece490516ed4aaf3a1e.png)
四、strlen
获得字符串的长度
stylen(从字符串开头到\0中间字符的个数(不包含\0,包含空格))
eg: char a[]={"hello world"};
x=strlen(a);
![](https://i-blog.csdnimg.cn/blog_migrate/4a91f9cb8f3166b361508805326a3e41.png)
![](https://i-blog.csdnimg.cn/blog_migrate/58ec1a83f0fa87d566ba29e06fdb0686.png)