在下面程序运行 #include<iostream.h> int func(char s[]){ int length=0; while(*(s+length))length++; return length

admin2009-01-15  27

问题 在下面程序运行    #include<iostream.h>    int func(char s[]){       int length=0;       while(*(s+length))length++;       return length;    }    void main(){       char a[10], *ptr=a;       cin>>ptr;       cout<<fune(ptr)<<end1;    }    如果输入字符串Hello!并回车,则输出结果为 ______。

选项 A、4
B、7
C、6
D、5

答案4

解析
转载请注明原文地址:https://jikaoti.com/ti/23d0FFFM
0

最新回复(0)