my strlen

简介:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*编写一个函数Strlen(char *s)求s字符串的长度并进行测试。*/
#include <iostream>
using  namespace  std;
int  Strlen( char  *str)
{
     int  len=0;
     while (*(str+len)!= '\0' )
     {
         len++;
     }
     return  len;
}
int  main()
{
     cout<< "zhang的字符个数为" <<Strlen( "zhang" )<<endl;
}
相关文章
|
5月前
strlen,strcpy,stract,strcmp,strstr函数的模拟实现
strlen,strcpy,stract,strcmp,strstr函数的模拟实现
50 3
|
5月前
|
C语言
字符串函数`strlen`、`strcpy`、`strcmp`、`strstr`、`strcat`的使用以及模拟实现
字符串函数`strlen`、`strcpy`、`strcmp`、`strstr`、`strcat`的使用以及模拟实现
|
5月前
|
存储 编译器 C语言
strlen函数详解
strlen函数详解
141 2
strlen和sizeof详解
strlen和sizeof详解
81 0
|
C语言
自己实现strcpy和strlen函数
自己实现strcpy和strlen函数
83 0
|
11月前
sizeof和strlen的对比
sizeof和strlen的对比
42 0
strlen的实现
strlen的实现
49 0
sizeof与strlen练习
sizeof与strlen练习
47 0
strlen, strcpy,strcmp,strcat,strncpy,strncmp,strncat,strst库函数的详细解析以及模拟实现
🐰strlen 🐰模拟strlen 🐰strcpy 🐰模拟strcpy 🐰strcat 🐰模拟strcat 🐰strcmp 🐰模拟strcmp 🐰strncpy 🐰strncat 🐰strncmp 🐰strstr 🐰模拟strstr