本文包括以下内容
目录
函数的描述
strlen函数用于求字符串长度,从首元素的地址开始,查找到'\0'元素的出现,返回从首元素开始,返回'\0'之前的元素个数。
函数的使用与声明
使用库函数strlen时,注意需要引入头文件 #include<string.h>
函数my_strlen的模拟实现
目录
函数的描述
strlen函数用于求字符串长度,从首元素的地址开始,查找到'\0'元素的出现,返回从首元素开始,返回'\0'之前的元素个数。
函数的使用与声明
使用库函数strlen时,注意需要引入头文件 #include<string.h>
函数my_strlen的模拟实现