首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有以下程序: #include main() { FILE*f; f=fopen("filea.txt","W"); fprintf(f,"abe"); fclose(f); } 若文本文件filea.txt中
有以下程序: #include main() { FILE*f; f=fopen("filea.txt","W"); fprintf(f,"abe"); fclose(f); } 若文本文件filea.txt中
admin
2020-01-10
23
问题
有以下程序:
#include
main()
{ FILE*f;
f=fopen("filea.txt","W");
fprintf(f,"abe");
fclose(f);
}
若文本文件filea.txt中原有内容为:hello,则运行以上程序后,文件filea.txt中的内容为( )。
选项
A、helloabe
B、abelo
C、abe
D、abchello
答案
C
解析
fopen("filea.txt","w’);表示以只写模式打开filea.txt,fprintf(f,"abc");是先将文件清空再写入。所以filea.txt中内容为abe。
转载请注明原文地址:https://kaotiyun.com/show/TFCp777K
本试题收录于:
二级C语言题库NCRE全国计算机二级分类
0
二级C语言
NCRE全国计算机二级
相关试题推荐
若有以下程序#includeintk=7,m=5;voidf(int**s){int*t=&k;S=&t;*s=&m;printf("%d,%d,%d,",k,*t,**s);}
以下叙述中正确的是
以下选项中不能用作C程序合法常量的是
在以下给出的表达式中,与while(E)中的(E)不等价的表达式是
编写函数intfun(intlim,intaa[MAX]),其功能是求出小于或等于lim的所有素数并放在aa数组中,并返回所求出的素数的个数。注意:部分源程序在文件PROG1.C中。请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花
下列给定程序中函数fun的功能是:通过某种方式实现两个变量值的交换,规定不允许增加语句和表达式。例如,变量a中的值原为8,b中的值原为3,程序运行后a中的值为3,b中的值为8。请改正程序中的错误,使它得出正确的结果。注意:不要改动main函数,不得增
设有下面的定义:structst{inta;floatb;)d;int*p;要使p指向结构变量d中的a成员,正确的赋值语句是()。
设二叉树的前序序列为.ABDEGHCFIJ,中序序列为DBGEHACIFJ。则后序序列为
若已建立以下链表结构,指针p、s分别指向如图所示结点则不能将s所指节点插入到链表末尾的语句组是
设序列长度为n,在最坏情况下,时间复杂度为O(10g2n)的算法是()。
随机试题
简述专门的学前科学教育活动的类型。
人们看书时,用红笔圈出重点,便于重新阅读,是利用了知觉的【】
t.i.d.的含义是
下列选项中,不属于政府采购特点的是()。
根据《机电产品国际招标投标实施办法》的规定,采用最低评标价法评标的,投标文件如有缺漏项,评标时须将()计入其评标总价。
根据《水利工程建设重大质量与安全事故应急预案》,按事故的严重程度和影响范围,将水利工程建设质量与安全事故分为()级。
有关估算指标的作用说法不正确的是()。
1.2014年1月14日,中共中央总书记、国家主席、中央军委主席习近平在中国共产党第十八届中央纪律检查委员会第三次全体会议上发表重要讲话。他强调,坚持党要管党、从严治党,强化党对党风廉政建设和反腐败工作统一领导,强化反腐败体制机制创新和制度保障,加强思想政
有人认为,每年都有大量的移民涌入英国,占用了大量的公共资源,并抢走了本地人的就业机会,所以这些人支持英国“脱欧”。以下哪项如果为真,最能质疑上述观点?
一桩投毒谋杀案,作案者要么是甲,要么是乙,二者必有其一,所用毒药或者是毒鼠强或者是乐果,二者至少其一。如果上述断定为真。则以下哪项推断一定成立?I.该投毒案不是甲投毒鼠强所为,因此一定是乙投乐果所为。Ⅱ.在该案侦破中发现甲投了
最新回复
(
0
)