首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下面程序输出的结果是( )。 #include<iostream> using namespace std; int fuc (char *x); int main(){ cout<<fuc("hello")<<
下面程序输出的结果是( )。 #include<iostream> using namespace std; int fuc (char *x); int main(){ cout<<fuc("hello")<<
admin
2013-02-27
19
问题
下面程序输出的结果是( )。 #include<iostream> using namespace std; int fuc (char *x); int main(){ cout<<fuc("hello")<<endl; return 0; } int fuc(char *x){ char *y=x; while(*y! =’\0’)y++; return(y-x); }
选项
A、5
B、6
C、0
D、语法错误,不能输出结果
答案
1
解析
函数fuc()的功能是计算字符串x的长度,因此程序的输出是5。
转载请注明原文地址:https://kaotiyun.com/show/dENp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
有如下类的定义,下划线处的语句是()。classMyClass{_______________intx,y;Public:MyClass(inta=0,intb=0){x=a;y=b;}staticvoidchange(){y-=
下面程序的输出结果是()。#include<iostream>usingnamespacestd;voidmain(){charcl=’a’,c2=’c’;cout.put(’a’)
下列函数的功能是()。#include<iostream>usingnamespacestd;voidmain(){chara;inti;cin>>a;
下列不属于结构化分析常用工具的是()。
对于长度为n的线性表,在最坏情况下,下列各排序法的比较次数中正确的是()。
若有定义:doublea[3][5];那么数组a的最后一个元素是【】。
假定Myclass为一个类,则执行Myclassa[4],*p[2];语句时,自动调用该类的构造函数()次。
以下错误的if语句是()。
数据库DB、数据库系统DBS、数据库管理系统DBMS之间的关系是()。
【】允许用户为类定义一种模式,使得类中的某些数据成员及某些成员函数的返回值能取任意类型。
随机试题
债券基金的久期与基金组合中各个债券的久期的关系是()。
A.翼腭神经节B.三叉神经节C.耳神经节D.下颌下神经节E.星状神经节与腮腺分泌活动有关的神经节是()
十二经的输穴多分布在
对沥青混合料路面接缝的施工要求,下列()说法是正确的。
给水工艺预处理方法一般包括()。
金融工具的流动性是指()。
教育部在2001年6月8日正式颁布的《基础教育课程改革纲要(试行)》提出的课程改革的核心理念是()。
注意培养学生研究态度与能力的课程类型是()。
《中华人民共和国宪法》规定公民的通信自由和通信秘密受法律保护。下列说法正确的是()。
设有如下事件过程:PrivateSubCommand1_Click() Dima a=Array(3,5,6,3,2,6,5,3,5,4,3,9,4,5,6,3,5) x=0 n=UBound(a)
最新回复
(
0
)