下列打开文件的表达式中,错误的是( )。A.ofstream ofile;ofile.open("C:\\vc\\a.txt",ios::binary);B.fstream iofile;iofile.open("a.txt",ios::ate);C.ifstream ifile("C:\\vc\\a.txt");D.cout.open("C:\\vc\\s.txt",ios::binary);

下列打开文件的表达式中,错误的是( )。

A.ofstream ofile;ofile.open("C:\\vc\\a.txt",ios::binary);

B.fstream iofile;iofile.open("a.txt",ios::ate);

C.ifstream ifile("C:\\vc\\a.txt");

D.cout.open("C:\\vc\\s.txt",ios::binary);


相关考题:

以下哪个命令可以正确打开文件() A.F=open(r‘c:\windows\a.txt’)B.F=open(‘c:\windows\a.txt’)C.F=open(c:\windows\a.txt)D.F=open(rc:\windows\a.txt)

下列关于c++流的描述中,错误的是( )。A.cout>>’A’表达式可输出字符AB.eof函数可以检测是否到达文件尾C.对磁盘文件进行流操作时,必须包含头文件fstreamD.以ios_base::0ut模式打开的文件不存在时,将自动建立一个新文件

下列关于C++流的描述中,错误的是( )。A.cout>>A表达式中输出字符AB.eof函数可以检测是否到达文件尾C.对磁盘文件进行流操作时,必须包含头文件fstreamD.以ios_base::Out模式打开的文件不存在时,将自动建立一个新文件

下面表示打开c盘存在文件abc而,输出的内容加在末尾的是( )。A.ofstream myf("c:\\abc");B.ofstream myf("c:\\abc",ios::outlios:: trund);C.ofstream myf("c:\\abc",ios::outlios:: ate);D.ofstream myf("c:\\abc",ios::out);

下列打开文件的表达式中,错误的是( )。A.ofstream ofile;ofile.open("C:\\vc\LabC.txt",ios::binary);B.fstream iofile;iofile.open("abC.txt",ios::ate);C.ifstream ifile("C:\\vc\abC.txt");D.cout.open("C:\\vc\abC.txt",ios::binary);

( 26 )下列关于 C++ 流的描述中,错误的是A ) cout'A' 表达式可输出字符 AB ) eof() 函数可以检测是否到达文件尾C )对磁盘文件进行流操作时,必须包含头文件 fstreamD )以 ios_base::out 模式打开的文件不存在时,将自动建立一个新文件

( 34 )打开文件时可单独或组合使用下列文件打开模式① ios_base::app ② ios_base::binary③ ios_base::in ④ ios_base::out若要以二进制读方式打开一个文件,需使用的文件打开模式为A ) ①③B ) ①④C ) ②③D ) ②④

以下不能正确创建输出文件对象并使其与磁盘文件相关联的语句是( )。A.ofstream myfile;mynle.open(“d:ofile.txt”);B.ofstream * mynle=new ofstream;mynle->open(“d:Ofile.txt”);C.ofstream myhle(“d:ofile.txt”);D.ofstream * mynle=new(“d:ofile.txt”);

当ifstream流类定义一个流对象并打开一个磁盘文件时,文件的隐含打开方式为( )。A.ios::inB.ios::outC.ios::inlios::outD.ios::binary

下列打开文件的表达式中,错误的是A.ofstream ofile;ofile.open("C:\\vc\\abc.txt",ios::binary);B.fstream iofile;iofile.open("abc.txt",ios::ate);C.ifstream ifile("C:\\vcXXabc.txt");D.cout.open("C:\\vc\\abc.txt",ios::binary);

当使用ifstream流类定义一个流对象并打开一个磁盘文件时,文件的隐含打开方式是 ( )。A.ios::inB.ios::outC.ios::truncD.ios::binary

以下程序的执行结果是_______。 include include include void 以下程序的执行结果是_______。include<iostream.h>include<fstream.h>include<stdlib.h>void main(){char ch:fstream file:file.open("abc.dat",ios::out1ios::inlios::binary);if(! file){cout<<“abc.dat文件不能打开”<<endl:abort

以下不能正确创建输出文件对象并使其与磁盘文件相关联的语句是A.ofstream myfile:myfile, open("d:ofile.txt");B.ofstream *myfile=new ofstream;myfile->open("d;ofile.txt");C.ofstream myfile("d:ofile.txt");D.ofstream *myfile=new ("d:ofile.txt");

以下程序企图把从键盘终端输入的字符输出到名为abc.txt的文件中,当从终端读到字符'#'时,结束输入和输出操作。但该程序有错。 #include <iostream> #include <fstream> using namespace std; int main() { ofstream ofile; char ch; ofile.open("d:\\abc.txt", 'W'); do{ cin>>ch; ofile.put(ch); }while(ch!='#'); ofile.close(); return 0; } 程序出错的原因是( )。A.成员函数open调用形式错误B.输入文件没有关闭C.成员函数put调用形式错误D.对象ofile定义错误

在文件操作中,代表以追加方式打开文件的模式是A.ios: :ateB.ios: :appC.ios: :outD.ios: :trunc

有以下程序:include include using namespace std;int main ( ){ ofstream 有以下程序: #include <iostream> #include <fstream> using namespace std; int main ( ) { ofstream ofile; char ch; ofile.open ("abc.txt"); cin>>ch; while (ch!='#' ) { cin>>ch; ofile.put(ch);A.程序编译时出错B.abc#C.abcD.#

以下不能正确创建输出文件对象并使其与磁盘文件相关联的语句组的选项是 ( )。A.ofstream cfile; cfile.open( "d : ofile.txt" );B.ofstream * cfile = new ofstream; cfile -> open( "d : ofile.txt );C.ofstream cfile( "d: ofile.txt" );D.ofstream * cfile = new( "d : ofile.txt" )

阅读以下程序 include void main( ) { ifstream infile; ofstream outfile; fstream 阅读以下程序#include<fstream.h>void main( ){ifstream infile;ofstream outfile;fstream iofile;iofile.open("a.txt",ios::in);iofile.close( );iofile.open("b.txt",ios::out);}下列描述错误的是A.对象infile只能用于文件输入操作B.对象outfile只能用于文件输出操作C.对象iofile在文件关闭后,不能再打开另一个文件D.对象iofile可以打开一个文件同时进行输入和输出

进行二进制文件操作时,在打开文件方式中增加ios::binary选项。

已知文本文件abc.txt,以读方式打开,下列的操作中错误的是()。A、fstreaminfile("abc.txt",ios::in)B、ifstreaminfile("abc.txt")C、ofstreaminfile("abc.txt")D、fstreaminfile;infile.open("abc.txt",ios::in)

下列打开文件的表达式中,()是错误的。A、ofstream ofile;ofile.open("abc.txt",ios::binary);B、fstream iofile;iofile.open("abc.txt",ios::ate);C、ifstream ifile("abc.txt");D、cout.open("abc.txt",ios::binary);

Open语句中,关键字For用于指定打开文件的方式,下列说法错误的是()。A、For Input指顺序打开文件,只能读取文件内容。B、For Output指顺序打开文件,向文件写入内容。C、For Append指顺序打开文件,向文件写入内容,与For Output不同的是,它覆盖原有的内容。D、For Binary指以二进制方式打开文件。

判断题进行二进制文件操作时,在打开文件方式中增加ios::binary选项。A对B错

单选题已知文本文件abc.txt,以读方式打开,下列的操作中错误的是()。Afstreaminfile("abc.txt",ios::in)Bifstreaminfile("abc.txt")Cofstreaminfile("abc.txt")Dfstreaminfile;infile.open("abc.txt",ios::in)

单选题Open语句中,关键字For用于指定打开文件的方式,下列说法错误的是()。AFor Input指顺序打开文件,只能读取文件内容。BFor Output指顺序打开文件,向文件写入内容。CFor Append指顺序打开文件,向文件写入内容,与For Output不同的是,它覆盖原有的内容。DFor Binary指以二进制方式打开文件。

单选题打开文件时可单独或组合使用下列文件打开模式(  )。①ios_base::app②ios_base::binary③ios_base::in④ios_base::out若要以二进制读方式打开一个文件,需使用的文件打开模式为A①③B①④C②③D②④

单选题下列打开文件的表达式中,()是错误的。Aofstream ofile;ofile.open(abc.txt,ios::binary);Bfstream iofile;iofile.open(abc.txt,ios::ate);Cifstream ifile(abc.txt);Dcout.open(abc.txt,ios::binary);