首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
在下面程序运行 #include<iostream.h> int func(char s[]){ int length=0; while(*(s+length))length++; return length
在下面程序运行 #include<iostream.h> int func(char s[]){ int length=0; while(*(s+length))length++; return length
admin
2009-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
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
若有以下程序段structst{intn;structst*next;);structsta[3]={5,&a[1],7,&a[2],9,’\0’},*p;p=&a[0];则以下选项中值为6的表达式是
有以下程序:#include<stdio.h>voidfun(char*t,char*s){while(*t!=0)t++;while((*t++=*s++)!=0);}main(){charss[10]="acc",aa[10]="
有以下程序#includeintfuna(inta,intB){returna+b;}intfunb(inta,intB){returna-b;}intsss(int(*t)(),intx,inty){return((*t)(x,y));}mai
关于C语言的变量,以下叙述中错误的是
设有如下关系表:则下列操作正确的是()。
下列队列的描述中,正确的是()。
有以下程序:#include<stdio.h>doublefun(intn){staticdoublef=1;f*=n:returnf;}main(){inti;doubles=0:for(i=1;i<6;i++)s+=
下列数据结构中,能用二分法进行查找的是()。
下列关于逻辑运算符两侧运算对象的叙述中正确的是()。
C语言程序中,运算对象必须是整型数的运算符是()。
随机试题
A.皮肤B.静脉注射C.呼吸道D.内服E.关节腔内硫酸镁通过()给药,产生中枢抑制作用
关于高温养护法,不正确的是()
植物防护的植灌木与种草、铺草皮配合使用,使坡面形成良好的防护层,适用于()。
()的特点是给定输入一经设定就维持不变,希望输出维持在某一特定值上。
基于互联网的项目信息门户(PIP)属于电子商务两大分支中的( )。
银行常用的市场营销控制方法不包括()
甲公司向乙银行借款1000万元,甲公司未按约定的借款用途使用借款。根据合同法律制度的规定,乙银行可以采取的措施有()。
RecentsurveysshowthatJapaneseyouthhavebecomea"MeGeneration"thatrejectstraditionalvalues."Around1980manyJa
HowlongdidittakeforalettertogettotheUSAsixyearsago?
A-----Guardagainstdamp.J-----Openhere.B-----Handlewithcare.K-----Openindarkroom.C-----Keepaway
最新回复
(
0
)