Exam 17: Templates
Exam 1: Introduction to Computer and C++ Programming56 Questions
Exam 2: C++ Basics57 Questions
Exam 3: More Flow of Control45 Questions
Exam 4: Procedural Abstraction and Functions That Return a Value53 Questions
Exam 5: Functions for All Sub Tasks54 Questions
Exam 6: Io Streams As an Introduction to Objects and Classes52 Questions
Exam 7: Arrays48 Questions
Exam 8: Strings and Vectors69 Questions
Exam 9: Pointers and Dynamic Arrays39 Questions
Exam 10: Defining Classes61 Questions
Exam 11: Friends, Overloaded Operators, and Arrays in Classes56 Questions
Exam 12: Separate Compilation and Namespaces41 Questions
Exam 13: Pointers and Linked Lists64 Questions
Exam 14: Recursion48 Questions
Exam 15: Inheritance53 Questions
Exam 16: Exception Handling47 Questions
Exam 17: Templates35 Questions
Exam 18: Standard Template Library59 Questions
Select questions type
Given a search template function that will look for an occurrence of target in an array of items, what is necessary for the instantiating data type to implement?
(Multiple Choice)
4.8/5
(36)
If you have a class template declared and you instantiate it in you program twice once with an integer, once with a string), how many versions of the class does the compiler create?
(Short Answer)
4.8/5
(31)
Which of the following describes a class that would be a good candidate for conversion to a template class?
(Multiple Choice)
4.9/5
(36)
If you define some list class template in your program, and then declare a list of integers, 2 lists of doubles and 1 list of strings, how many different version of the template class will the compiler provide?
(Multiple Choice)
4.8/5
(36)
If you have a class template declared and you instantiate it in you program twice both times it is instantiated with an integer), how many versions of the class does the compiler create?
(Short Answer)
4.8/5
(39)
In a class template implementation, every use of the class name as the name of the class should be followed by <T>.
(True/False)
4.9/5
(32)
If you define a function template, then the compiler will create a separate function definition for every data type that exists.
(True/False)
4.7/5
(36)
When would you want to make a function a function template?
(Multiple Choice)
4.8/5
(36)
The C++ code
template <class T>
is called the ______________________
(Short Answer)
4.9/5
(38)
In the following function template, what must be true in order to use the function with a given data type?
Template <class T>
Int smallest T array[], int size)
{
Int small=0, i;
Fori=0;i<size;i++)
{
Ifarray[i] < array[small])
Small=i;
}
Return small;
}
(Multiple Choice)
4.8/5
(37)
In a template function definition, all parameters must be of the template class T).
(True/False)
4.7/5
(37)
Showing 21 - 35 of 35
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)