#include<stdio.h>标签:arr,return,递归,my,ret,str,字符串,长度,strlen From: https://blog.51cto.com/u_15923331/5983599
int my_strlen(char*str)
{
if (*str != '\0')
return 1 + my_strlen(str + 1);
else
return 0;
}
int main()
{
int ret = 0;
char arr[] = "hi bit";
ret = my_strlen(arr);
printf("字符串长度为%d", ret);
return 0;
}