#include "stdio.h"
#include "string.h"
void main()
int k;
char st[]="I love this game";
k=strlen(st);
printf("The lenth of the string is %d\n",k);
输出结果:
The lenth of the string is 16
当我们用到字符串的一些库函数时,往往会使用#include "string.h"这句。
#include "stdio.h"
int strlenMe(char *p)
int i=0;
while(*p!='\0')
{i++;p++;}
return i;
void main()