Filters
Question type

Study Flashcards

Assume you have opened and connected stream variables fileIn and fileOut.Assume further that you have finished with input file,but want to read the input file a second time.What is necessary to set the stream state to reread the file from the start? Explain.

Correct Answer

verifed

verified

To do this requires a call to ...

View Answer

Given the following code.The input file,in.dat,is a copy of the program code in this problem.How will the output file,out.dat,differ from the input file? // file: testQuestion.cc // test question: copy files: in.dat to out.dat // in.dat is a copy of a file containing this code. // use EOF to terminate copy loop #include <fstream> #include <cstdlib> // for exit() using namespace std; int main() { ifstream in; ofstream out; in.open("in.dat"); out.open("out.dat"); while(in >> ch) out << ch; return 0; }

Correct Answer

verifed

verified

The code line
in >> ch
will ignore all w...

View Answer

cin is an output stream object of type ostream.

A) True
B) False

Correct Answer

verifed

verified

Showing 41 - 43 of 43

Related Exams

Show Answer