Give the following class template, what changes need to be made to the default constructor definition?
template
class containerClass
{
public:
containerClass();
containerClass(int newMaxSize);
containerClass(const containerClass& source);
~containerClass();
T getItem();
int getCount();
int getSize();
void addItem(T 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
d. all of the above
e. none of the above
d. all of the above
You might also like to view...
When should a program explicitly use the this reference?
a) accessing a private variable b) accessing a public variable c) accessing a local variable d) accessing a field that is shadowed by a local variable
DBMSs that maintain inactive data for an extended period of time seldom flag records.
Answer the following statement true (T) or false (F)
To ____ the image, Monette would place the pointer near an edge of the bounding box, and then when the pointer changes to a curved double-headed arrow, drag the pointer.
a. scale b. rotate c. distort d. skew
Office 365, OneDrive, and DropBox are all examples of what type of computing?
A. Public cloud B. Private cloud C. Domain D. Open cloud