首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include<stdio.h> voidfun(char*t,char*s) {while(*t!=0)t++; while((*t++=*s++)!=0); } main( ) {charss[10]=’’acc’’,aa[10]=
有以下程序 #include<stdio.h> voidfun(char*t,char*s) {while(*t!=0)t++; while((*t++=*s++)!=0); } main( ) {charss[10]=’’acc’’,aa[10]=
admin
2014-06-19
19
问题
有以下程序
#include<stdio.h>
voidfun(char*t,char*s)
{while(*t!=0)t++;
while((*t++=*s++)!=0);
}
main( )
{charss[10]=’’acc’’,aa[10]=“bbxxyy’’;
fun(ss,aa);printf(’’%s,%s\n’’,SS,aa);
}
程序的运行结果是
选项
A、acc,bbxxyy
B、accxxyy,bbxxyy
C、accbbxxyy,bbxxyy
D、accxyy,bbxxyy
答案
C
解析
fun函数中,第1个while循环语句使指针t指向字符串的末尾,第2个while循环语句实现了字符串t和s的连接。主函数中语句fun(ss,aa)的功能是将字符串aa连接到字符串ss的末尾。
转载请注明原文地址:https://kaotiyun.com/show/iYJp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
以下程序的输出结果是main(){inta=4,b=5,c=0,d;d=!a&&!b||!c;printf(“%d\n”,d;}
若定义:inta=511,*b=&a;则printf(“%d\n”,*b);的输出结果为
在一个C程序中
分析下列程序:main(){intx=1,y=0,a=0,b=0;switch(a){case1:switch(b){case0:x++;case1:
以下程序的运行结果是______。structNode}intx;charch;};fun(structNode*sn)}statick=1;sn->x=20;
若有如下程序:sub(inta,intb,intc){c=a+b;return(c);}main(){intx=3,y=4,z=6;sub(x,y,z);printf(’%d”,z);
若有如下程序:sub(p,n)int(*p)[3],n;{inti;for(i=0;i<=n;i++)printf("%d",p[i][2]);}main(){ints[3][3]={1,2,
随机试题
一般认为麻风菌侵入另一个体最主要的途径包括
脊髓半侧损害(Brown—Sequard综合征)最常见于
某企业拟更新原设备,新旧设备的详细资料如下:假设企业最低报酬率为10%,企业适用所得税税率为25%,新、旧设备均按直线法计提折旧。请分析一下该企业应否更新。
班主任对一个班集体的发展起()。
简述晏阳初关于“四大教育”和“三大方式”教育主张的主要内容。
编写如下程序:PrivateSubCommand1_Click()Dima(3,3)AsIntegerDimiAsInteger,jAsIntegerFori=1To3Forj=
CarsAreGoodfortheEnvironmentBritain’smotorindustryisplanningamajorpublicitycampaigntocounterwhatitseesas
Thisbookprovidesyouwiththesimplebasicsforbeingphysicallyfit.【21】______yourageorpresentstateoffitness,you
Nowadays,manypeopleusecomputerstohandleordinaryissuessuchasbankingandofficework,andtospendtheirsparetimeon
A、Humansshouldstopdamagingtheenvironment.B、Theearthwillnotbesuitableforhumans.C、Theweatherreportseemstobemor
最新回复
(
0
)