设有如下函数定义。若在主函数中用语句cout<<f("good")调用上述函数,则输
问题:
设有如下函数定义。若在主函数中用语句cout<<f("good")调用上述函数,则输出结果为 (48) 。
int f(char *s)
char *p=s;
while(*p! =’\0’)p++;
return(p-s);
A.3
B.4
C.5
D.6
设有如下函数定义。若在主函数中用语句cout<<f("good")调用上述函数,则输出结果为 (48) 。
int f(char *s)
char *p=s;
while(*p! =’\0’)p++;
return(p-s);
A.3
B.4
C.5
D.6