填空题
下面程序要实现的功能是打开当前目录下的文件abc,并向其追加一串字符“How are you!”,然后再关闭该文件,请将程序填写完整。
#include<fstream.h>
void main()
[13]
f<<"How are you!"<<end1;
f.close();
【参考答案】
ofstream f( "abc" , los: :app)
点击查看答案
<上一题
目录
下一题>
热门
试题
填空题
从键盘上输入XXYYZZXYZWXP和X,以下程序的输出结果是 [9] 。 #include<iostream.h> #include<string.h> void main() char*str,ch; int count=0,pos; cin>>str>>ch; pos=strlen(str)-1; while(pos>=0) if((str[pos])=ch)count++; pos--; cout<< count= <<count;
点击查看答案
填空题
下列程序的输出结果是 [10] 。 #include<iostream.h> #include<string.h> void main() char b[30]; strcpy(&b[0], XY ); strcpy(&b[1], YZW ); strcpy(&b[2], ZXY ); cout<<b<<end1;
点击查看答案
相关试题
定义重载函数时,应在参数个数或参数类型上...
每个对象都维护了一个指向自身的指针,这个...