首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
以下程序的输出是【 】。 main() { char str1[]="How do you do",*p1=str1; strcpy(str1+strlen(str1)/2,"es she"); printf("%s\n",p1); }
以下程序的输出是【 】。 main() { char str1[]="How do you do",*p1=str1; strcpy(str1+strlen(str1)/2,"es she"); printf("%s\n",p1); }
admin
2013-02-23
24
问题
以下程序的输出是【 】。
main()
{
char str1[]="How do you do",*p1=str1;
strcpy(str1+strlen(str1)/2,"es she");
printf("%s\n",p1);
}
选项
答案
How does she
解析
strcpy(str1,s1);字符串拷贝函数,作用是将字符串s1拷贝到字符数组strl中去。strlen(str):测试字符串str的长度,函数的值为字符串中实际长度,不包括’\0’在内。本题中strlen(str1)的值为13,则strcpy(strl+strlen(strl)/2,"es she");相当于strcpy(strl+6,"es she");,因此可得答案为How does she
转载请注明原文地址:https://kaotiyun.com/show/MQJp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
设下面程序的可执行文件名为“prg.exe”,在该程序所在子目录下输入以下命令行:prghellogood<回车>则程序的输出结果是______。main()(intargc,char*argv[]){inti;if(argc<=0)
下列程序的输出结果是______。inti=010,J=10;printf("%d,%d\n",++i,j--);
下列程序的输出结果是______。#includemain(){charb[30],*chp;strcpy(&b[0],"CH");strcpy(6b[1],"DEF");strcpy
计算圆的周长、面积和球体积。#definePI3.1415926#define【】L=2*PI*R;【】;V=4.0/3.0*PI*R*R*Rmain(){floatr,l,s,v;printf("input
若有以下定义和语句,则对w数组元素非法引用的是______。intw[2][3],(*pw)[3];pw=w;
以下叙述中不正确的是
假定变量x为int类型,请以最简单的形式写出与逻辑表达式!x等价的C语言关系表达式【】。
下面不属于软件设计原则的是()
检查软件产品是否符合需求定义的过程称为()
有下面程序段 char a[3],b[]="China"; a=b; printf("%3",a);则下面的说法正确的是______。
随机试题
下列画家中,属于印象派画家的是【】
在等容舒张期,心脏瓣膜的状态是【】
24小时尿量少于多少称为无尿
跛行诊断中确诊患部的主要方法可能是()。
期货交易实行保证金制度,交易者不需要付出与合约金额相等的全额货款,只需要付()的履约保证金。
账务处理程序就是指记账程序。()
投资者必须在证券交易所设立账户,才能买卖的国债是()。
贯彻“以人为本”的教育理念首先应该做到()。
如果把一杯酒倒进一桶污水中,你得到的是一桶污水;如果把一杯污水倒进一桶酒中,你得到的仍然是一桶污水。在任何组织中,都有可能存在几个难缠人物,他们存在的目的似乎就是把事情搞糟。如果一个组织不加强内部管理,一个正直能干的人进入某低效的部门就会被吞没,而一个无德
中国精神之所以是兴国强国之魂,是因为()
最新回复
(
0
)