用C++解决问题第十版Chapter11
TRUE/FALSEFriend functions are members of the class. ANSWER: FALSEAll operators can be overloaded.AN
TRUE/FALSE 1. Friend functions are members of the class. ANSWER: FALSE 2. All operators can be overloaded. ANSWER: FALSE 3. If you have mutators and accessors, you should not have friend functions also ANSWER: FALSE 4. Friend functions may directly modify or access the private data members. ANSWER: TRUE 5. The following is aproperly declared overloaded insertion operator for myClass. ostream& operator «(ostream &out, const myClass &obj); ANSWER: TRUE 6. Functions that are constant member functions may call the class mutator functions. ANSWER: FALSE 7. Functions that are constant member functions may call constant class accessor functions. ANSWER: TRUE 8. You cannot create new operators (such as the quote). ANSWER: TRUE 9. Operators must be friends of the class. ANSWER: FALSE 10. You may not change the precedence of operators by overloading them ANSWER: TRUE Short Answer 1. If agiven task being performed by afunction involves more than one object, then that function should normally be afunction. ANSWER: friend 2. If agiven task being performed by afunction involves one object, then that function should normally be afunction. ANSWER: member 3. Afunction is not amember of the class, but has access to the private members of the class. ANSWER: friend 4. An overloaded extraction or insertion operator should return ANSWER: areference to the stream 5. Afriend function needs to be passed an object of the class. If the friend only needs to access the object, but not change its data members, then the object should be passed as ________________________ ANSWER: aconstant reference 6. An operator that expects only one parameter is called aoperator ANSWER: unary 7. An operator that expects two parameters is called aoperator. ANSWER: binary 8. In order to do automatic type conversion for your class, you would write ANSWER: overloaded functions or overloaded constructors 33. Which of the following are not correct? a. The destructor of aclass is not named the same as the name of the class, but

