strlen()计算字符串str的长度,直到空结束字符,但不包括空结束字符串。个人觉得就是查字符的个数
C中函数声明为
size_t strlen(const char *str)
c中
#include <stdio.h>
#include<string.h>
int main()
{
char s[10000]="Pulse-Level";
int len=strlen(s);
printf("%d \n",len);//11
return 0;
}
C++中
#include <iostream>
#include<cstring>
using namespace std;
int main()
{
char s[10000]="Pulse-Level";
cout << strlen(s);//11
return 0;
}