单选题
C语言
题号 #2273268
有以下函数
int fun(char*X,char*y)
{ int n=0;
while((*x= = =*y)&&*x!='\O'){x++; y++; n++;}
return n;
}
函数的功能是( )。
参考答案
B
答案解析
由题中while(*x==*y&&*x!='\n')可知此函数是统计x和y所指向的字符串中最前面的联系相同的字符的个数。
你可能感兴趣的试题
A.if(strcmp(sl,s2)= =0)puts(s1);
B.if(strcmp(sl,s2)!=0)puts(s2);
C.if(strcmp(sl,s2)= =l)puts(s1);
D.if(strcmp(sl,s2)!=0)puts(s1);
A.double fun(double a[l5])
B.double fun(double *a) 。
C.double fun(double a[])
D.double fun(double a)
A.beijing
B.china
C.welcome
D.tiananmen