Exam 13: Overloading and Templates
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of C++50 Questions
Exam 3: Input/Output50 Questions
Exam 4: Control Structures I (Selection)50 Questions
Exam 5: Control Structures II (Repetition)50 Questions
Exam 6: User-Defined Functions50 Questions
Exam 7: User-Defined Simple Data Types, Namespaces, and the string Type50 Questions
Exam 8: Arrays and Strings50 Questions
Exam 9: Records (structs)50 Questions
Exam 10: Classes and Data Abstraction50 Questions
Exam 11: Inheritance and Composition50 Questions
Exam 12: Pointers, Classes, Virtual Functions, Abstract Classes, and Lists50 Questions
Exam 13: Overloading and Templates50 Questions
Exam 14: Exception Handling50 Questions
Exam 15: Recursion50 Questions
Exam 16: Linked Lists50 Questions
Exam 17: Stacks and Queues50 Questions
Exam 18: Searching and Sorting Algorithms50 Questions
Exam 19: Binary Trees50 Questions
Exam 20: Graphs50 Questions
Exam 21: Standard Template Library (STL)50 Questions
Select questions type
Which of the following is the syntax to overload the operator function operator[] as a member function of a class for constant arrays?
Free
(Multiple Choice)
4.8/5
(29)
Correct Answer:
B
Using a class template,you can write a single code segment for a set of related ____.
Free
(Multiple Choice)
4.9/5
(26)
Correct Answer:
A
The return type of the function to overload the operator >> must be a reference to a(n)____ object.
Free
(Multiple Choice)
4.8/5
(42)
Correct Answer:
D
Operators can be overloaded either for objects of the user-defined types,or for a combination of objects of the user-defined type and objects of the built-in type.
(True/False)
4.9/5
(40)
In C++,>> is used as a stream extraction operator and as a right shift operator.
(True/False)
4.8/5
(40)
The function that overloads the ____ operator for a class must be declared as a member of the class.
(Multiple Choice)
4.7/5
(32)
Which of the following is the general syntax of the function prototype to overload the post-increment operator as a member function?
(Multiple Choice)
4.8/5
(39)
To overload the pre-increment (++)operator for a class,if the operator function is a member of that class,it must have ____ parameter(s).
(Multiple Choice)
4.9/5
(40)
Which of the following is the syntax to overload the operator function operator[] as a member function of a class for nonconstant arrays?
(Multiple Choice)
4.8/5
(36)
The general syntax to overload the assignment operator = for a class is ____.
(Multiple Choice)
4.8/5
(38)
A class template is called a(n)____________________ type because it specifies how a generic class template is to be customized to form a specific template class.
(Short Answer)
4.9/5
(32)
Any function that overloads an operator is called a(n)____________________ function.
(Short Answer)
4.7/5
(38)
Suppose cType is a class template,and func is a member function of cType.The heading of the function definition of func is: ____.
(Multiple Choice)
4.8/5
(44)
Except for the ____________________ operator and the member selection operator,to use an operator on class objects,that operator must be overloaded.
(Short Answer)
4.7/5
(41)
A conversion constructor is a(n)____________________ parameter function.
(Short Answer)
4.8/5
(44)
A(n)____________________ constructor converts its argument to an object of the constructor's class.
(Short Answer)
4.8/5
(42)
The only built-in operations on classes are assignment (=)and ____________________.
(Short Answer)
4.8/5
(39)
Both parameters of the function to overload the operator << are reference parameters.
(True/False)
5.0/5
(34)
Showing 1 - 20 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)