Exam 11: Operator Overloading; String and Array Objects
Exam 1: Introduction to Computers, the Internet and the World Wide Web27 Questions
Exam 2: Introduction to C Programming21 Questions
Exam 3: Control Statements, Part 127 Questions
Exam 4: Control Statements, Part 228 Questions
Exam 5: Functions and an Introduction to Recursion47 Questions
Exam 6: Arrays and Vectors19 Questions
Exam 7: Pointers and Pointer-Based Strings28 Questions
Exam 8: Sequential-Access Files12 Questions
Exam 9: Classes35 Questions
Exam 10: Classes: a Deeper Look, Part 215 Questions
Exam 11: Operator Overloading; String and Array Objects32 Questions
Exam 12: Object-Oriented Programming: Inheritance19 Questions
Exam 13: Object-Oriented Programming: Polymorphism23 Questions
Exam 14: Templates13 Questions
Exam 15: Stream Inputoutput33 Questions
Exam 16: Exception Handling24 Questions
Exam 17: File Processing11 Questions
Exam 18: Class String and String Stream Processing26 Questions
Exam 19: Searching and Sorting10 Questions
Exam 20: Data Structures19 Questions
Exam 21: Standard Template Library Stl56 Questions
Exam 22: Bits, Characters, C Strings and Structs26 Questions
Exam 23: Boost Libraries, Technical Report 1 and C0x21 Questions
Exam 24: Other Topics19 Questions
Exam 25: ATM Case Study, Part 1: Object-Oriented Design With the Uml15 Questions
Exam 26: ATM Case Study, Part 2: Implementing an Object-Oriented Design3 Questions
Exam 27: Game Programming With Ogre23 Questions
Select questions type
Suppose the unary ! operator is an overloaded member function of class String. For a String object s, which function call is generated by the compiler when it finds the expression !s?
Free
(Multiple Choice)
4.7/5
(35)
Correct Answer:
A
An overloaded + operator takes a class object and a double as operands. For it to be commutative i.e., a + b and b + a both work):
Free
(Multiple Choice)
4.7/5
(46)
Correct Answer:
C
Which of the following lines would be the prototype for an overloaded cast operator function that converts an object of user-defined type Time into a double?
(Multiple Choice)
4.9/5
(43)
Which of the following is false about the new operator and the object for which it allocates memory?
(Multiple Choice)
4.9/5
(39)
A copy constructor must receive its argument by reference because:
(Multiple Choice)
4.8/5
(34)
The correct function name for overloading the addition +) operator is:
(Multiple Choice)
4.8/5
(30)
The prototypes of overloaded cast operator functions do not:
(Multiple Choice)
4.8/5
(35)
Which of the following operators can be overloaded as a global function?
(Multiple Choice)
4.9/5
(34)
Which of the following is not a disadvantage of default memberwise copy with objects containing pointers?
(Multiple Choice)
4.8/5
(39)
Assume that the function call operator) is overloaded for data type String in the usual sense of selecting a substring from a larger string. For a String object string1 with the character string "ABCDEFGHI", what string does string1 4 , 2 ) return?
(Multiple Choice)
4.7/5
(34)
The conventional way to distinguish between the overloaded preincrement and postincrement operators ++) is:
(Multiple Choice)
4.8/5
(35)
Suppose you have a programmer-defined data type Data and want to overload the << operator to output your data type to the screen in the form cout << dataToPrint; and allow cascaded function calls. The first line of the function definition would be:
(Multiple Choice)
4.8/5
(39)
There exists a data type Date with member function Increment that increments the current Date object by one. The ++ operator is being overloaded to postincrement an object of type Date. Select the correct implementation:
(Multiple Choice)
5.0/5
(41)
Showing 1 - 20 of 32
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)