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...
The Windows 8.1 default password policy requires that a password contains at least one number to meet the password complexity requirements
Indicate whether the statement is true or false
“I’m sure they won’t mind if we start sending them the report on these oversized computer sheets. All this time we’ve been condensing it, retyping it, and sending it to our biggest accounts, but we just can’t now. We’re so understaffed, we don’t have the time,” says Otto Breth. “I’ll just write a comment here telling them how to respond to this report, and then we can send it out.”
a. What potential problems do you see in casually changing external output? List them. b. Discuss in a paragraph how internal and external output can differ in appearance and function.