To read the entire remaining contents of the file as a string from a file object infile, which one should be used ? ( ) A: infile.read(2) B: infile.readline() C: infile.readlines() D: infile.read()
To read the entire remaining contents of the file as a string from a file object infile, which one should be used ? ( ) A: infile.read(2) B: infile.readline() C: infile.readlines() D: infile.read()
以写的方式打开文件“myfile.dat”的语句是()。 A: ifstrean<br/>infile("myfile.dat",ios::in); B: fstrean<br/>infile("myfile.dat",ios::app); C: fstrean<br/>infile("myfile.dat",ios::out); D: ofstrean<br/>infile("myfile.dat");
以写的方式打开文件“myfile.dat”的语句是()。 A: ifstrean<br/>infile("myfile.dat",ios::in); B: fstrean<br/>infile("myfile.dat",ios::app); C: fstrean<br/>infile("myfile.dat",ios::out); D: ofstrean<br/>infile("myfile.dat");
要求打开文件 d:\file.dat,可写入数据,正确的语句是( )。 A: ifstream infile("d:\file.dat", ios::in); B: ifstream infile("d:\\file.dat", ios::in); C: ofstream infile("d:\file.dat", ios::out); D: fstream infile("d:\\file.dat", ios::in| ios::out);
要求打开文件 d:\file.dat,可写入数据,正确的语句是( )。 A: ifstream infile("d:\file.dat", ios::in); B: ifstream infile("d:\\file.dat", ios::in); C: ofstream infile("d:\file.dat", ios::out); D: fstream infile("d:\\file.dat", ios::in| ios::out);
要求可打开文件:D:\file.dat 写入数据,错误的语句是? A: ifstream infile("D:\\file.dat", ios::in); B: fstream infile("D:\\file.dat", ios::in | ios::out); C: fstream infile("D:\\file.dat", ios::in); D: ofstream infile("D:\\file.dat", ios::out);
要求可打开文件:D:\file.dat 写入数据,错误的语句是? A: ifstream infile("D:\\file.dat", ios::in); B: fstream infile("D:\\file.dat", ios::in | ios::out); C: fstream infile("D:\\file.dat", ios::in); D: ofstream infile("D:\\file.dat", ios::out);
要求可打开文件:D:?ile.dat 写入数据,错误的语句是? A: ifstream infile("D:\file.dat", ios::in); B: fstream infile("D:\file.dat", ios::in); C: ofstream infile("D:\file.dat", ios::out); D: fstream infile("D:\file.dat", ios::in | ios::out);
要求可打开文件:D:?ile.dat 写入数据,错误的语句是? A: ifstream infile("D:\file.dat", ios::in); B: fstream infile("D:\file.dat", ios::in); C: ofstream infile("D:\file.dat", ios::out); D: fstream infile("D:\file.dat", ios::in | ios::out);
要求打开文件 d:?ile.dat,可写入数据,正确的语句是( )。 A: ifstream infile("d:?ile.dat", ios::in); B: ifstream infile("d:\file.dat", ios::in); C: ofstream infile("d:?ile.dat", ios::out); D: fstream infile("d:\file.dat", ios::in| ios::out);
要求打开文件 d:?ile.dat,可写入数据,正确的语句是( )。 A: ifstream infile("d:?ile.dat", ios::in); B: ifstream infile("d:\file.dat", ios::in); C: ofstream infile("d:?ile.dat", ios::out); D: fstream infile("d:\file.dat", ios::in| ios::out);
要求打开文件"d:\file.dat",可写入数据,正确的语句是要求打开文件"d:\file.dat",可写入数据,正确的语句是要求打开文件"d:\file.dat",可写入数据,正确的语句是 A: ifstream infile("d:\file.dat", ios::in);ifstream infile("d:\file.dat", ios::in); B: ifstream infile("d:\\file.dat", ios::in); C: ofstream infile("d:\file.dat", ios::out); D: fstream infile("d:\\file.dat", ios::in|ios::out);
要求打开文件"d:\file.dat",可写入数据,正确的语句是要求打开文件"d:\file.dat",可写入数据,正确的语句是要求打开文件"d:\file.dat",可写入数据,正确的语句是 A: ifstream infile("d:\file.dat", ios::in);ifstream infile("d:\file.dat", ios::in); B: ifstream infile("d:\\file.dat", ios::in); C: ofstream infile("d:\file.dat", ios::out); D: fstream infile("d:\\file.dat", ios::in|ios::out);
要求打开文件f:\myfile.dat,并能够写入数据,正确的语句是( )。 A: ifstream infile("f:\\myfile.dat", ios::in); B: ifstream infile("f:\\myfile.dat ", ios::out); C: ofstream outfile("f:\\myfile.dat ", ios::in); D: fstream infile("f:\\myfile.dat ", ios::in | ios::out);
要求打开文件f:\myfile.dat,并能够写入数据,正确的语句是( )。 A: ifstream infile("f:\\myfile.dat", ios::in); B: ifstream infile("f:\\myfile.dat ", ios::out); C: ofstream outfile("f:\\myfile.dat ", ios::in); D: fstream infile("f:\\myfile.dat ", ios::in | ios::out);
要求打开文件f:\myfile。dat,并能够写入数据,正确的语句是( )。 A: ofstream outfile("f:\\myfile.dat ", ios::in); B: ifstream infile("f:\\myfile.dat", ios::in); C: fstream infile("f:\\myfile.dat ", ios::in | ios::out); D: ifstream infile("f:\\myfile.dat ", ios::out);
要求打开文件f:\myfile。dat,并能够写入数据,正确的语句是( )。 A: ofstream outfile("f:\\myfile.dat ", ios::in); B: ifstream infile("f:\\myfile.dat", ios::in); C: fstream infile("f:\\myfile.dat ", ios::in | ios::out); D: ifstream infile("f:\\myfile.dat ", ios::out);
阅读以下程序,对程序功能的描述中正确的是 #icnlude int main() { FILE *in, *out; char ch, infile[10], outfile[10]; printf("Enter the infile name:"); scanf("%s", infile); printf("Enter the outfile name:"); scanf("%s", outfile); if ((in = fopen(infile, "r")) == NULL) { printf("cannot open infile."); exit(0); } if ((out = fopen(outfile, "w")) == NULL) { printf("cannot open outfile."); exit(0); } while (!feof(in)) { fputc(fgetc(in), out); } fclose(in); fclose(out); return 0; }
阅读以下程序,对程序功能的描述中正确的是 #icnlude int main() { FILE *in, *out; char ch, infile[10], outfile[10]; printf("Enter the infile name:"); scanf("%s", infile); printf("Enter the outfile name:"); scanf("%s", outfile); if ((in = fopen(infile, "r")) == NULL) { printf("cannot open infile."); exit(0); } if ((out = fopen(outfile, "w")) == NULL) { printf("cannot open outfile."); exit(0); } while (!feof(in)) { fputc(fgetc(in), out); } fclose(in); fclose(out); return 0; }