【单选题】【消耗次数:1】
设有如下函数定义 int f(char *s) { char *p=s; while(*p!=’\0’) p++; return(p-s); } 在主函数中用cout<<f(“good”)调用上述函数, 则输出结果为( )
3
4
5
6
参考答案:
复制
纠错
相关题目
【单选题】 设有如下函数定义 int f(char *s) { char *p=s; while(*p!=’\0’) p++; return(p-s); } 在主函数中用cout<<f(“good”)调用上述函数, 则输出结果为( )。
①  3
②  4
③  5
④  6
【单选题】 设有如下函数定义 int f(char *s) { char *p=s; while(*p!=’\0’) p++; return(p-s); } 在主函数中用coutf(“good”)调用上述函数, 则输出结果为( )
①  3
②  4
③  5
④  6
【单选题】 设有如下函数定义 int f(char *s) { char *p=s; while(*p!=’\0’) p++; return(p-s); } 在主函数中用coutf(“good”)调用上述函数, 则输出结果为( )。
①  3
②  4
③  5
④  6
【单选题】 以下函数的返回结果是() int function(char *x) { char *p=x; while(*p++); return(p-x-1); }
①  求字符串的长度
②  将字符串x连接到字符串p后面
③  将字符串x复制到字符串p中
④  将字符串x反向存放
【单选题】 以下函数的返回结果是(????) int function(char *x) { char *p=x; while(*p++); return(p-x-1); }
①  求字符串的长度
②  将字符串x连接到字符串p后面
③  将字符串x复制到字符串p中
④  将字符串x反向存放
【单选题】 以下函数的返回结果是( )。 int function(char *x) { char *p=x; while(*p++); return(p-x-1); }
①  求字符串的长度B.将字符串x连接到字符串p后面
②  将字符串x复制到字符串p中
③  将字符串x反向存放
【单选题】 以下函数的返回结果是( )。 int function(char *x) { char *p=x; while(*p++); return(p-x-1); }
①  求字符串的长度B.将字符串x连接到字符串p后面
②  将字符串x复制到字符串p中
③  将字符串x反向存放
【单选题】 程序段char a[ ]=“English”; char *p=a; int n=0;while( *p!=‘\0’){ n++; P++;}结果中,P指向( )。
①  A. 字符h
②  B.a
③  C. 字符串的结束符
④  D.7
【单选题】 程序段char a[ ]=“English”; char *p=a; int n=0; while( *p!=‘\0’){ n++; p++;} 结果中,n的值是( )。
①  A. 6
②  B.8
③  C.5
④  D.7
【单选题】 已定义以下函数 fun(int*p) {return*p;} 该函数的返回值是()
①  不确定的值
②  形参p中存放的值
③  形参p所指存储单元中的值
④  形参p的地址值
随机题目
【判断题】 Two mineral water, please.
①  正确
②  错误
【判断题】 Paul and I are in the same company. We goes to work together.
①  正确
②  错误
【判断题】 It take me two hours to finish my work today.
①  正确
②  错误
【判断题】 Do you want some milk?
①  正确
②  错误
【判断题】 A: Hello, is that Paul White? B: No, this is John.
①  正确
②  错误
【判断题】 A: Whos calling, please? B: I am Peter.
①  正确
②  错误
【判断题】 A: Hello, could I speak to Jack, please? B: Who are you?
①  正确
②  错误
【判断题】 A: Hi, Dave. Hows it going? B: Pretty good.
①  正确
②  错误
【单选题】 It [填空] two hours for him to repair his computer.
①  take
②  takes
③  took
④  taking
【单选题】 Tom [填空] get up a little earlier tomorrow.
①  needs
②  need
③  need to
④  needs to