编写函数strength(*s),函数返回指针s所指字符串的长度。(注意:相当于库函数strlen的功能)
最佳答案
简单地定义下就可以了:
int strength(char *s)
{
int len=0;
while(*s++) len++;
return len;
}
最佳答案由网友 whoami1978 提供
其他回答
暂无其它回答!
简单地定义下就可以了:
int strength(char *s)
{
int len=0;
while(*s++) len++;
return len;
}
暂无其它回答!