有以下程序 #include int fun(char s[]){ char*p=s; while(*p!=0) p++; return(p-s);) main(){ printf(

admin2019-08-10  11

问题 有以下程序
    #include
    int fun(char s[]){
      char*p=s;
    while(*p!=0)  p++;
      return(p-s);)
      main(){
      printf("%d\n",fun("0ABCDEF"));)
    程序运行后的输出结果是

选项 A、6
B、7
C、1
D、0

答案B

解析 函数fun的主要功能是计算字符串中实际字符的个数,因此主函数中调用fun得到结果为7。
转载请注明原文地址:https://jikaoti.com/ti/fof0FFFM
0

最新回复(0)