Multiple Choice
Give the following class template, what changes need to be made to the default constructor definition?
Template <class T>
Class containerClass
{
Public:
ContainerClass) ;
ContainerClassint newMaxSize) ;
ContainerClassconst containerClass& source) ;
~containerClass) ;
T getItem) ;
Int getCount) ;
Int getSize) ;
Void addItemT item) ;
Private:
T *bag;
Int maxSize, count;
};
ContainerClass::containerClass)
{
MaxSize = 10;
Bag = new int[maxSize];
Count=0;
}
A) add the template prefix
B) change the type of the dynamic array allocation to T
C) add the <T> following the class name before the scope resolution operator
D) all of the above
E) none of the above
Correct Answer:

Verified
Correct Answer:
Verified
Q11: Given a class template named listClass, declare
Q12: You may not have overloaded friend operators
Q13: Given the following template function definition, which
Q14: Why can you not use the swap
Q15: Given a class template, how many different
Q17: Templates are an example of algorithm abstraction
Q18: In a template, all members must be
Q19: Which of the following are valid template
Q20: If you want to make a function
Q21: Given a search template function that will