A . FileOutputStream out=new FileOutputStream(“file.txt”,true);
B . OutputStream out=new FileOutputStream(“file.txt”,“append”);
C . OutputStream out=new FileOutputStream(“file.txt”);
D . FileOutputStream out=new FileOutputStream(new file(“file.txt”));
E . OutputStream out=new FileOutputStream(new File(“file.txt”),true.;
[单选题]现有一个文件file21.txt,其内容是: abCdEf, 执行下列程序之后,输出的结果是______。 package ch1; import java,io.*; public class ex21 { static String name = "ch1//file21.txt"; public static void main(String[] args) { try { readFile (); } catch(IOException ioe) { System.out.print
[单选题]有一个名为init.txt的文件,内容如下:#define HDY(A,B) A/B # define PRINT(Y) Printf(“y=%d/n.,Y) 有以下程序#include “init.txt” main() {int a=1,b=2,c=3,d=4,k; K=HDY(a+c,b+d); PRINT(K); } 下面针对该程序的叙述正确的是( )。A.编译有错B.运行出错C.运行结果为 y=0D.运行结果为 y=6
[单选题]有一个名为init.txt的文件,内容如下: #define HDY(A,B) A/B #define PRINT(Y) printf("y=%d/n",Y) 有以下程序 #include"init.txt" main() { int a=1,b=2,c=3,d=4,k; k=HDY(a+c,b+d); PRINT(k); } 下面针对该程序的叙述正确的是A.编译出错B.运行出错C.运行结果为y=0D.运行结果为y=6
[单选题]有一个名为 init.txt 的文件,内容如下:#define HDY(A,B) A/B#define PRINT(Y) Printf("y=%d/n",Y)有以下程序#include "init.txt"main( ){ int a=1,b=2,c=3,d=4,k ;k =HDY(a+c , b+d) ;PRINT( k ) ;}下面针对该程序的叙述正确的是A.) 编译出错B.) 运行出错C.) 运行结果为 y=0D.) 运行结果为 y=6
[单选题](24)假定用下面的语句打开文件:Open"File l .txt"For Input As#1则不能正确读文件的语句是A.)Input # 1, ch$B.)Line Input # 1, ch$C.)ch$=Input$(5, # 1)D.)Read # 1, ch$
[单选题]已知outfile 是一个输出流对象,要想将outfile 的文件指针定位到当前位置之前321字节处,正确的函数调用语句是______ 。A.outfile.seekp (321, ios_ base:: cur);B.outfile.seekp (321,ios_ base:: beg);C.outfile.seekp (-321,ios_ base:: beg);D.outfile.seekp (-321,ios_ base:: cur);
[单选题]以下不能正确创建输出文件对象并使其与磁盘文件相关联的语句是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");
[单选题]以下不能正确创建输出文件对象并使其与磁盘文件相关联的语句是( )。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”);
[单选题]以下不能正确创建输出文件对象并使其与磁盘文件相关联的语句是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");
[单选题]以下语句用于打开一个顺序文件“Open ″C:\MyFile.txt″ For OutPut”,但是该语句的一个重要错误是没有( )。A.指定打开方