首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序 #include #include void fun ( char *s ) { char a[10]; strcpy( a, "STRING" ); s = a; } main() { char *p="PROGRAM"; fun
有以下程序 #include #include void fun ( char *s ) { char a[10]; strcpy( a, "STRING" ); s = a; } main() { char *p="PROGRAM"; fun
admin
2019-12-17
26
问题
有以下程序
#include
#include
void fun ( char *s )
{
char a[10];
strcpy( a, "STRING" );
s = a;
}
main()
{
char *p="PROGRAM";
fun( p );
printf("%s\n",p);
}
程序运行后的输出结果是(此处□代表空格)
选项
A、STRING
B、STRING□□□□
C、STRING□□□
D、PROGRAM
答案
D
解析
本题考查字符串指针作为函数参数,本题中p作为字符串指针传入fun中,p指向的内容并没有发生变化,所以选项D正确。
转载请注明原文地址:https://kaotiyun.com/show/BmCp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
以下选项中,能正确进行字符串赋值的是
软件调试的目的是
在软件开发中,需求分析阶段产生的主要文档是
软件生命周期中的活动不包括
在数据库系统中,用户所见的数据模式为
数据库管理系统是
下关于算法的叙述错误的是
实体电影和实体演员之间的联系是()。
人员的记录由编号和出生年、月、日组成,N名人员的数据已在主函数中存入结构体数组std中。函数fun的功能是:找出指定出生年份的人员,将其数据放在形参k所指的数组中,由主函数输出,同时由函数值返回满足指定条件的人数。请在程序的下画线处填入正确的内容
随机试题
论述元朝统一的历史意义。(2018年历史学统考真题)
巫术活动对审美的原始发生的重要意义的表现是什么?
在市场经济条件下,如果其他方面没有大的问题,运营负荷的高低应主要取决于()。
正本海运提单上批注有:“TOTALFIVEHUNDREDCARTONSONLY.BUTTENBROKENCARTONS.”若来证对提单没有特别要求,银行将不接受该提单。()
集合资产管理计划的投资者人数不超过()人。
晋升竞赛的主要特征包括()。
[*]
设A为n阶可逆矩阵(n≥2),则[(A*)*]-1=________.(用A*表示).
Syntaxisabouttheprincipleofformingcorrect______.
Eatingfruitsandvegetableshasprovedhelpfulinpreventingvariouschronic(慢性的)illnesses.Doesthatmeanthemorethebetter?
最新回复
(
0
)