函数题:字符串长度 - C/C++ 指针及引用
strLength()函数用于统计指针s所指向的以0结尾的字符串的长度(字符个数),请实现该函数,使得下述程序可以正确运行。注意不能使用原生的strlen()函数。
### 函数接口定义:
c++
unsigned int strLength(const char* s);
### 裁判测试程序样例:
c++
#include <stdio.h>
//在此处定义strLength()函数
int main()
{
char s[1024];
gets(s);
printf("%d",strLength(s));
return 0;
}
### 输入样例:
in
spring festival
### 输出样例:
out
15
### 感觉不会? 那试着听听**免费的B站网课**
[简洁的C和C++ - 重庆大学在线课程](https://www.bilibili.com/video/BV1it411d7zx/)
[Python编程基础及应用 - 重庆大学在线课程](https://www.bilibili.com/video/BV1kt411R7uW/)

答案:若无答案欢迎评论
### 函数接口定义:
c++
unsigned int strLength(const char* s);
### 裁判测试程序样例:
c++
#include <stdio.h>
//在此处定义strLength()函数
int main()
{
char s[1024];
gets(s);
printf("%d",strLength(s));
return 0;
}
### 输入样例:
in
spring festival
### 输出样例:
out
15
### 感觉不会? 那试着听听**免费的B站网课**
[简洁的C和C++ - 重庆大学在线课程](https://www.bilibili.com/video/BV1it411d7zx/)
[Python编程基础及应用 - 重庆大学在线课程](https://www.bilibili.com/video/BV1kt411R7uW/)

答案:若无答案欢迎评论