字符串函数的使用
1、字符串长度函数-strlen
输出结果:
2、字符串拷贝函数strcpy
3、字符串拷贝函数strncpy
4、字符串连接函数strcat
输出
5、字符串连接函数strncat
输出
6、字符串比较函数strcmp
输出
7、字符串比较函数strncmp
输出:
strchr:查找字符串中第一个出现的指定字符
输出:o world
strrchr(查找字符串中最后一个出现的指定字符)
输出:orld
strpbrk(查找字符串中第一个出现的指定字符)
输出:
strstr:在一字符串中查找指定字符串
strtok:分割字符串
memcpy ()用来拷贝src 所指的内存内容前n个字节到dest所指的地址上。与strcpy ()不同的是,memcpy ()会完整的复制n个字节,不会因遇到字符串结束\0'而结束。
清空src