Exam2_08_Sol.3 - d. a and c 37. Standard stream operators...

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

View Full Document Right Arrow Icon
For questions 24-30 answer "a" for "declaration but not definition" and "b" for "declaration and also definition." 24. class Bad_area; "a" 25. class Bad_area{}; "b" 26. int x; "b" 27. extern int x; "a" 28. void f(double); "a" 29. void f(double a){}; "b" 30. struct Point; "a" 31. A destructor is called a. when an object goes out of scope 32. Global variables b. are visible everywhere except where there is another variable with the same name 33. Private data members of a class c. are visible to all members of the class, including function members defined outside the class. 34. Function arguments are visible a. only in the function body 35. To perform input and output, our program interfaces directly b. to an input/output library 36. An input stream takes characters sequentially from a buffer and
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: d. a and c 37. Standard stream operators >> and << d. all of the above 38. A disk and a flash drive are ideal to store files because c. these devices retain their data when power is off 39. It is best to access a file with an output stream using c. open the stream, check the stream error state, then use << 40. Assume the following code: struct Reading { int hour; double temp; ostream& operator << (ostream& os, const Reading& rng) { return os << '(' << _____ << ',' << _____ << ')'; } }; To overload << for the user defined type Reading, the two blanks should be b. rng.hour and rng.temp 41. Assume the following code: void skip_to_int() { if(cin.fail()) {...
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