函数mystrlen(char *s)的功能是求字符串s的长度,请填空。 mystrlen(char *s) { char *t: t=s; while(【 】)t++; return(t-s);

admin2009-02-15  20

问题 函数mystrlen(char *s)的功能是求字符串s的长度,请填空。
   mystrlen(char *s)
   {  char *t:
      t=s;
       while(【  】)t++;
      return(t-s);
   }

选项

答案*t

解析 通过while循环扫描字符串,遇到字符‘\0’结束,并用t统计字符串的长度。
转载请注明原文地址:https://kaotiyun.com/show/pwXp777K
0

最新回复(0)