Google
 
Webcprogramming.com




An Affiliate of AIHorizon




Quiz: C++ File I/O

If you're not sure you're ready to take a quiz on C++ File I/O, be sure to through Cprogramming.com's C++ File I/O tutorial. Otherwise, best of luck!

1. Which of the following classes handlers file input?
A. ofstream
B. ifstream
C. instream
D. inputfile

2. Which of the following is not a valid ofstream argument?
A. ios::app
B. ios::trunc
C. ios::noreplace
D. ios::create

3. What does ios::ate mean as an argument to ofstream?
A. Open file, but do not create.
B. Open file, create.
C. Open file, allow additions to the end.
D. Open file, allow additions anywhere.

4. How would you output to an open file named a_file?
A. a_file.out("Output");
B. a_file="Output";
C. a_file<<"Output";
D. a_file.printf("Output");

5. What header file contains C++ file I/O instructions?
A. iostream.h
B. fstream.h
C. infstream.h
D. outstream.h


Answer Key
Next lesson: Lesson 11, typecasting


Bookmark and Share



-----
Subscribe to cprogramming.com by Email
Interested in advertising with us?
Please read our privacy policy.
Copyright © 1997-2009 Cprogramming.com. All rights reserved.