CS201p Quiz 13 Fall 22 Soltuion by GetReady

 

CS201p Quiz 13 Fall 22 Soltuion by GetReady

 

Which of the following is correct format of template function?

template <typename T>

 

CS201p Quiz 13 Fall 22 Soltuion by GetReady

In class, if we have to use dynamic memory allocation, we must define a _____ for it.

destructor

 

CS201p Quiz 13 Fall 22 Soltuion by GetReady

In template class, compiler makes a copy of ___ and converts in to _____.

--------

 

CS201p Quiz 13 Fall 22 Soltuion by GetReady

We can always specify a member initializer to call a _______constructor.

Initializer

CS201p Quiz 13 Fall 22 Soltuion by GetReady


Declaration and definition of a template function should be in the ___ file.

Header file

 

CS201p Quiz 13 Fall 22 Soltuion by GetReady

Suppose you want to find the square of a number using template square. Which data type you cannot use to call it? cs201

Non-numeric type

 

CS201p Quiz 13 Fall 22 Soltuion by GetReady

Which of the following is not an advantage of templates? cs201

------

 

CS201p Quiz 13 Fall 22 Soltuion by GetReady

Which of the following header file deals with stream extraction?

<iostream>.

 

CS201p Quiz 13 Fall 22 Soltuion by GetReady

When we call a function and pass an argument, an object or variable to the function, it is called?

"passing by value".

 

CS201p Quiz 13 Fall 22 Soltuion by GetReady

‘T’ is ___ data type in “template <class T>.

generic