C语言提问,大家帮忙看看这个程序段的功能是什么.拜托给个分析

来源:百度知道 编辑:UC知道 时间:2024/06/02 15:02:57
sss(s,t)
char *s,*t;
{while ((*s)&&(*t++ = *s++));
return(*s-*t); }
A 求字符串的长度 B 比较两个字符串的大小 C 将字符串s复制到字符串t 中
D将字符串s接续到字符串t 中

C
这是老式函数写法,等于:
int sss(char *s, char *t)
{
while ((*s) && (*t++ = *s++)) { ;}; // 循环
return(*s - *t);
}

(*t++ = *s++) -- 将字符串s复制到字符串t
while ( (*s) ..) -- 循环到字符串终了
return(*s - *t); -- 返回值,成功0

C