Exam2_08.6 - 39. It is best to access a file with an output...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
36. An input stream takes characters sequentially from a buffer and a. converts them into values of various types b. writes values to a console, a file, main memory, etc. c. returns an error state d. a and c e. b and c 37. Standard stream operators >> and << a. are type safe b. format values c. are extensible to user defined types d. all of the above e. none of the above 38. A disk and a flash drive are ideal to store files because a. file streams can be repositioned using seekg() and seekp() b. files are really just byte sequences c. these devices retain their data when power is off d. data loss can never occur on these devices e. their cost-per-byte to performance ratio is better than main memory
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 39. It is best to access a file with an output stream using a. << b. open the stream first then << c. open the stream, check the stream error state, then use << d. any of the above e. none of the above 40. Assume the following code: struct Reading { int hour; double temp; ostream& operator << (ostream& os, const Reading& rng) { return os << '(' << _____ << ',' << _____ << ')'; } }; To override << for the user defined type Reading, the two blanks should be a. os.hour and os.temp b. rng.hour and rng.temp c. hour and temp d. any of the above e. none of the above...
View Full Document

This note was uploaded on 02/18/2012 for the course CSCE 121 taught by Professor Walter daugherity during the Fall '09 term at Texas A&M.

Ask a homework question - tutors are online