对于如下程序:  #include    main( )  {    FILE *fp;    fp=fopen(“file.txt”,“w”);    fprintf(fp,“%s”,“xyz”);    fclose(fp);  }  若文件file.txt中原有的内容为good,则运行该程序以后,文件file.txt中的内容为()

对于如下程序:  #include    main( )  {    FILE *fp;    fp=fopen(“file.txt”,“w”);    fprintf(fp,“%s”,“xyz”);    fclose(fp);  }  若文件file.txt中原有的内容为good,则运行该程序以后,文件file.txt中的内容为()


相关考题:

有如下程序: include using namespace std; class TestClass{ int k; public: TestCla 有如下程序:include<iostream>using namespace std;class TestClass{int k;public:TestClass(int x=1):k(x){}~TestClass O{cout<<k;}};int main(){TestClass a[]={TestClass(3),TestClass(3),TestClass(3)};TestClass *p=new TestClass[2];delete []p;return ():}这个程序的输出结果是______。

有如下程序 include include using namespace std; int main( 有如下程序 #include<iostream> #include<iomanip> using namespace std; int main(){ cout<<setprecision(3)<<fixed<<setfill('*')<<setw(8); cout<<12.345<<_______<<34.567; return 0; } 若程序的输出是: ** 12.345**34.567 则程序中下划线处遗漏的操作符是A.setprecision(3)B.fixedC.setfill('*')D.setw(8)

有如下程序 include include using namespace std; cla 有如下程序 #include <iostream> #include <iomanip> using namespace std; class MyClass { public: MyClass() { cout<<'A'; } MyClass(char c){ cout<<c; } ~MyClass(){ cout<<'B'; } }; int main( ) { MyClass p1,*p2; p2=new MyClass('X'); delete p2; return 0; } 执行这个程序屏幕上将显示输出A.ABXB.ABXBC.AXBD.AXBB

有如下程序 include using namespace std; class Base { protected: 有如下程序 #include <iostream> using namespace std; class Base { protected: Base( ){cout<<'A'; } Base(char c) { cout<<c; } }; class Derived: public Base { public: Derived(char c){ cout<<c; } }; int main( ){ Derived d1 ('B'); return 0; } 执行这个程序屏幕上将显示输出A.BB.BAC.ABD.BB

有如下程序: include using namespace std; class Sample{ public: 有如下程序: #include<iostream> using namespace std; class Sample{ public: Sample()<) ~Sample(){cout<<'*';} }; int main(){ Sample temp[2],*pTemp[2]; return 0; } 执行这个程序输出星号(*)的个数为( )。A.1B.2C.3D.4

有如下的程序: include include using namespace st 有如下的程序: #include<cstring> #include<iostream> using namespace std; class MyString { public: MyString(const char*s); ~MyString(){delete[]data;} Protected: unsigned len; char*data; }; MyString::MyString(const char*s) { len=strlen(s); data=new char[len+1]; strcpy(data,s); } int main() { MyString a("C++Programing"); MyString b(a); return 0; } 在运行上面的程序时出错,出错的原因是A.构造函数的实参不允许是本类的对象B.没有定义实现深层复制(深拷贝)的拷贝构造函数C.构造对象a时实参与形参类型不符D.系统不能生成缺省的拷贝构造函数

执行如下程序后的输出结果是【】。include include using namespace std;int ma 执行如下程序后的输出结果是【 】。include <iostream>include <fstream>using namespace std;int main ( ){char s[25];ofstream fl("data.txt");f1<<"C++ Programming";f1.close ();ifstream f2 ("data.txt");

有如下程序: include using namespace std; int main() { char st 有如下程序: #include <iostream> using namespace std; int main() { char str[100], *p; cout<<"Please input a string:"; cin>>str; p=str; for (int i=0; *p!='\0'; p++,i++); cout<<i<<endl; return 0; }运行这个程序时,若输入字符串为 abcdefgabcd则输出结果是A.7B.12C.13D.100

有如下程序:include include using namespace std;int main(){cout.fill(' 有如下程序:#include <iostream>#include <iomanip>using namespace std;int main(){cout.fill('*');cout<<left<<setw(4)<<123<< "OK"<<end1;return 0;}执行这个程序的输出结果是( )。A.123*OKB.123*OK**C.*123OKD.*123**OK

有如下的程序: include include using namespace std; int main() { ofstr 有如下的程序:include <iostream>include <fstream>using namespace std;int main(){ofstream outf("D:\\temp.txt",ios_base::trunc) ;outf<<"World Wide Web";outf.close();ifstream inf("D:\\temp.txt");char s[20];inf>>s;inf.close();cout<<s;return 0;}执行后的输出结果是【 】。

以下程序的输出结果是【】。 include include void main 0 { char s[50]; st 以下程序的输出结果是【 】。include<iostream.h>include <string.h>void main 0 {char s[50];strcpy(s[O], "No" );strcpy(s[1], "123" );strcpy (s[2], "23456" );cout<<s;}

有如下程序: include using namespace std; int main() { cout.f 有如下程序: #include<iostream> using namespace std; int main() { cout.fill('*') cout.width(6); cout.fill('#') cout<<123<<endl; return 0; } 执行后的输出结果是A.###123B.123###C.***123D.123***

有如下程序: include using namespace std; class BASE { public 有如下程序: #include<iostream> using namespace std; class BASE { public: ~BASE(){cout<<"BASE";} }; class DERIVED:public BASE { public: ~DERIVED(){cout<<"DERIVED";} }; int main(){DERIVEDx;retum 0;} 执行后的输出结果是A.BASEB.DERIVEDC.BASEDERIVEDD.DERIVEDBASE

下列程序的输出结果是()。 include main() {stmct st {int y,x,z; }; union {long i; i 下列程序的输出结果是( )。#include<stdio.h>main(){ stmct st{ int y,x,z;};union{ long i;int j;char k;}un;printf("%d,%d\n",sizeof(stmct st),sizeof(un));}A.6,2B.6,4C.8,4D.8,6

有如下程序: include using namespace std; class PARENT { public: PARENT() { cout 有如下程序:include <iostream>using namespace std;class PARENT{public:PARENT() { cout <<"PARENT"; }};class SON : public PARENT{public:SON() {cout << "SON"; }};int main(){SON son;PARENT *p;p = son;return 0;}执行上面程序的输出是______。

有如下程序: include using namespace std; template T total(T * data) 有如下程序:include<iostream>using namespace std;template<typename T>T total(T * data) {T s=0;While(* data)s+ = *data + +;return s;}int main(){int x[]:{2,4,6,8, 10, 12, 14, 16, 18};cout<<total(x);

有如下程序:include using namespacestd;int main(){cout.fill('*');cout.width(6);c 有如下程序: #include <iostream> using namespace std; int main(){ cout.fill('*'); cout.width(6); cout.fill('#'); cout<<123<<end1; return 0;} 执行后的输出结果是A.###123B.123###C.***123D.123***

有以下程序 include struct st { int x,y;} data[2]={1,10,2,20}; main( 有以下程序 #include <stdio.h> struct st { int x,y;} data[2]={1,10,2,20}; main() { struct st *p=data; printf("%d,",p->y); printf("%d\n",(++p)->x); } 程序的运行结果是______。A.10,1B.20,1C.10,2D.20,2

有如下的程序: include using namespace std; class AT{friend ostream operato 有如下的程序:include<iostream>using namespace std;class AT{friend ostream operator<<(ostream,AT);}at;ostream operator<<(ostream os,AT){return os<<'@';}int main(){cout<<"MyHome"<<at<<"isHere.com";}执行上面的程序将输出

有如下程序:include using namespace std;Class x{protected: int a;public: x() {a= 有如下程序: #include <iostream> using namespace std; Class x { protected: int a; public: x() { a=1; } }; class x1 : virtual public x { public: x1() { a+=1; cout<<A.1B.123C.242D.244

有如下程序:include using namespace std;class AA{public: virtual void f() {cout 有如下程序: #include <iostream> using namespace std; class AA { public: virtual void f() { cout<< "AA"; } }; class BB : public AA { public: BB() { cout << "BB"; } }; claA.AAB.AABBCCC.BBAABBCCD.BBBBAACC

有如下程序 include void main( ) { float x=2.0,y; if(x 有如下程序 #include<iostream.h> void main( ) { float x=2.0,y; if(x<0.0)y=0.0; else if(x<10.0)y=1.0/x; else y=1.0; cout < < y; } 该程序的输出结果是A.0B.0.25C.0.5D.1

有如下程序: include include using namespace std; int ma 有如下程序: #include <iostream> #include <iomanip> using namespace std; int main() { cout.fill('*'); cout << left << setw(4) << 123 << "OK" << endl; return 0; }A.123*OKB.123*OK**C.*123OKD.*123**OK

有如下程序include include using namespace std;class MyClass {public:M 有如下程序#include <iostream>#include <iomanip>using namespace std; class MyClass {public:MyClass(){ cout<<'A'; }MyClass(char c){ cout<<c; }~MyClass(){ cout<<'B'; }};int main() {MyClass p1,*p2;p2=new MyClass('X');delete p2;return 0;}执行这个程序屏幕上将显示输出( )。A.ABXB.ABXBC.AXBD.AXBB

有如下程序:include includeusing namespace std;int main(){cout.fill('* 有如下程序:#include <iostream>#include<iomanip>using namespace std;int main(){ cout.fill('*'); cout.width(6); cout.fill('#'); cout<<123<<end1; return 0;}执行后的输出结果是( )。A.###123B.123###C.***123D.123***

填空题对于如下程序:  #include    main( )  {    FILE *fp;    fp=fopen(“file.txt”,“w”);    fprintf(fp,“%s”,“xyz”);    fclose(fp);  }  若文件file.txt中原有的内容为good,则运行该程序以后,文件file.txt中的内容为()

单选题有如下程序:#include #include main(){ printf(%d,strlen(0\tA011\1));}程序运行后的输出结果是(  )。A8B9C7D10