Exam 10: Operator Overloading; String and Array Objects
Exam 1: Introduction to Computers and C++32 Questions
Exam 2: Introduction to C Programming; Inputoutput and Operators22 Questions
Exam 3: Introduction to Classes, Objects and Strings33 Questions
Exam 4: Control Statements, Assignment, and Operators29 Questions
Exam 5: Control Statements, Logical Operators31 Questions
Exam 6: Functions and an Introduction to Recursion48 Questions
Exam 7: Class Templates Array and Vector; Catching Exceptions18 Questions
Exam 8: Pointers and Pointer-Based Strings32 Questions
Exam 9: Classes: a Deeper Look; Throwing Exceptions35 Questions
Exam 10: Operator Overloading; String and Array Objects34 Questions
Exam 11: Object-Oriented Programming: Inheritance17 Questions
Exam 12: Object-Oriented Programming: Polymorphism27 Questions
Exam 13: Stream Inputoutput: a Deeper Look34 Questions
Exam 14: File Processing19 Questions
Exam 15: Standard Library Containers and Iterators33 Questions
Exam 16: Standard Library Algorithms27 Questions
Exam 17: Exception Handling: a Deeper Look20 Questions
Exam 18: Introduction to Custom Templates9 Questions
Exam 19: Custom Templatized Data Structures17 Questions
Exam 20: Searching and Sorting10 Questions
Exam 21: Class String and String Stream Processing28 Questions
Exam 22: Bits, Characters, C Strings and Structs30 Questions
Exam 23: Other Topics22 Questions
Exam 24: C++11 Additional Features56 Questions
Select questions type
Y and z are user-defined objects and the += operator is an overloaded member function. The operator is overloaded such that y += z adds z and y, then stores the result in y. Which of the following expressions is always equivalent to y += z?
Free
(Multiple Choice)
4.8/5
(32)
Correct Answer:
B
Which of the following is not a disadvantage of default memberwise copy with objects containing pointers?
Free
(Multiple Choice)
4.9/5
(33)
Correct Answer:
D
Because the postfix increment operator returns objects by value and the prefix increment operator returns objects by reference:
Free
(Multiple Choice)
4.8/5
(27)
Correct Answer:
D
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
(28)
To prevent class objects from being copied or assigned, you can:
(Multiple Choice)
4.8/5
(32)
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)
4.9/5
(29)
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):
(Multiple Choice)
4.8/5
(33)
A copy constructor must receive its argument by reference because:
(Multiple Choice)
4.7/5
(39)
Which of the following statements about a unique_ptr object is true?
(Multiple Choice)
4.9/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.9/5
(36)
Which of the following is false about the new operator and the object for which it allocates memory?
(Multiple Choice)
4.8/5
(37)
Showing 1 - 20 of 34
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)