当需要打开A盘上的abc.txt 文件用于输入时,则定义文件流对象的语句为______ 。A.fstream fin(“A: abc.txt”);B.ofstream fin (“A: abc.txt”);C.ifstream fin(“A: abc.txt”,ios:: app);D.ifstream fin(“A: abc.txt”,ios:: nocreate);

当需要打开A盘上的abc.txt 文件用于输入时,则定义文件流对象的语句为______ 。

A.fstream fin(“A: abc.txt”);

B.ofstream fin (“A: abc.txt”);

C.ifstream fin(“A: abc.txt”,ios:: app);

D.ifstream fin(“A: abc.txt”,ios:: nocreate);


相关考题:

当使用fstream流类定义一个流对象并打开一个磁盘文件时,文件的隐含打开方式为( )。A.ios::inB.ios::outC.ios::int|ios::outD.没有

当使用ofstream流类定义一个流对象并打开一个磁盘文件时,文件的默认打开方式为( )。A.ios base::inB.ios_base::binaryC.ios base::in|ios base::outD.ios base::out

( 16 )要建立文件流并打开当前目录下的文件 file.dat 用于输入,下列语句中错误的是A ) ifstream fin=ifstream.open ( "file.dat" ) ;B ) ifstream*fir.=new ifstream ( "file.dat" ) ;C ) ifstream fin; fin.open ( "file.dat" ) ;D ) ifstream *fin=new ifstream ( ) ; fin 一 open ( "file.dat" ) ;

( 26 )当使用 ifstream 流类定义一个流对象并打开一个磁盘文件时,文件的默认打开方式为A ) ios_base::inB ) ios_base::in|ios_base::outC ) ios_base::outD ) ios_base::inios_base::out

在打开函数中其中是在由指定的流上打开由路径名指定的文件,其返回值为指向文件流指针,此函数用于将一个指定的文件打开为一个预定义的标准流()A.openB.f openC.freopenD.f dopen

使用ifstream流类定义流对象并打开磁盘文件时,文件的隐含打开方式为( )。A.ios::in.B.ios::outC.ios::inlios::outD.没有默认

假设fin是一个文件流对象,则关闭文件的语句是______。

下列语句不能够用于打开C根目录下文件test.txt的语句是A.ifstream fin;fin.open("C:\\test.txt");B.ifstream fin("C:\\test.txt");C.A)和B)D.ifstream fin;fin("C:\\test.txt");

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

当使用fstream流类定义一个流对象并打开一个磁盘文件时,文件的隐含打开方式为( )。 A.ios::inS 当使用fstream流类定义一个流对象并打开一个磁盘文件时,文件的隐含打开方式为( )。A.ios::inB.ios::0utC.ios::in I ios::0utD.以上都不对

当使用fstream流类定义一个流对象并打开一个磁盘文件时,文件的隐含打开方式为A.ios∷inB.ios∷outC.ios∷in,|ios∷outD.以上都不对

要建立文件流并打开当前目录下的文件file.dat用于输入,下列语句中错误的是A.ifstream fin=ifstream.open(”file.dat”);B.ifstream*fin=new ifstream(”file.dat”);C.ifstream fin;fin.open(”file.dat”);D.ifstream*fin=new ifstream();fin-open(”file.dat”);

若要打开A盘上user了目录下名为abc.txt的文本文件进行读、写操作,下面符合此要求的函数调用是A.fopen("A:\user\abc.txt",","r")B.fopen("A:\\user\\abc.txt","r+")C.fopen("A:\user\abc.txt","rb")D.fopen("A:\\user\\abc.txt","w")

当使用ifstream流类定义一个流对象并打开一个磁盘文件时,文件的默认打开方式为( )。A.ios—base::inB.ios—base::in l ios base::0utC.los base;:0utD.ios_base::inios_base::0ut

使用ifstream 流类定义一个流对象并打开一个磁盘文件与用使用 fstream流类定义一个流对象并打开一个磁盘文件默认打开方式分别为______和没有默认。

在J2EE中,利用下列构造函数准备对文件abc.txt操作,但文件abc.txt在当前目录不存在,不会产生运行时错误的是()。 A、BufferedReader  breader=new BufferedReader(new FileReader("abc.txt"));B、PrintWriter out = new PrintWriter(new FileWriter(“abc.txt”),true);C、FileInputStream fin = new FileInputStream(“abc.txt”);D、OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(“abc.txt”));

当需要使用ifstream流类定义一个流对象并联系一个磁盘文件时,应在文件开始使用#include命令,使之包含()头文件。A、strstrea.hB、stdlib.hC、iostream.hD、fstream.h

使用打开文件函数open()之前,需要定义一个流类对象,使用open()函数来操作该对象。

在非标准文件操作中,应该先定义流对象,再打开文件,必须使用open()函数。

在文件操作中,通常使用打开文件的流对象的值来判断打开文件是否成功。

若要打开:A盘上user子目录下名为abc.txt的文本文件进行读、写操作,下面符合此要求的函数调用是()。A、fopen("A://user//abc.txt","r")B、fopen("A://user//abc.txt","r+")C、fopen("A://user//abc.txt","rb")D、fopen("A://userl//abc.txt","w")

单选题若要打开A盘上user子目录下名为abc.txt的文本文件进行读、写操作,下面符合此要求的函数调用是()。Afopen("A:/user/abC.txt","r")Bfopen("A://user//abC.txt","r+")Cfopen("A:/user/abC.txt","rb")DD.fopen("A://user//abtxt","w")

单选题在打开函数中其中是在由指定的流上打开由路径名指定的文件,其返回值为指向文件流指针,此函数用于将一个指定的文件打开为一个预定义的标准流()。AopenBfopenCfreopenDfdopen

判断题使用打开文件函数open()之前,需要定义一个流类对象,使用open()函数来操作该对象。A对B错

单选题要建立文件流并打开当前目录下的文件file.dat用于输入,下列语句中错误的是(  )。Aifstream fin=ifstream.open(“file.dat”);Bifstream* fin=new ifstream(“file.dat”);Cifstream fin; fin.open(“file.dat”);Difstream* fin=new ifstream(); fin-open(“file.dat”);

判断题在非标准文件操作中,应该先定义流对象,再打开文件,必须使用open()函数。A对B错

单选题当需要使用ifstream流类定义一个流对象并联系一个磁盘文件时,应在文件开始使用#include命令,使之包含()头文件。Astrstrea.hBstdlib.hCiostream.hDfstream.h