C++ Programming Multiple Choice Question - Templates

This section focuses on the "Templates" of the C++ programming. These Multiple Choice Questions (mcq) should be practiced to improve the C++ programming skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.

1.Which value is placed in the base class?

A. Derived values
B. Default type values
C. Both default type & derived values
D. None of the above

View Answer


2. What is a template?

A. A template is a formula for creating a generic class
B. A template is used to manipulate the class
C. A template is used for creating the attributes
D. None of the above

View Answer


3.Which of the following best defines the syntax for template function ?

A. template return_type Function_Name(Parameters)
B. template
return_type Function_Name(Parameters)
C. Both a and b
D. None of the above

View Answer


4.Templates are abstract recipe for producing a concrete code, and it is used for

A. Producing functions
B. Producing classes
C. Nothing
D. Both A and B

View Answer


5.How many parameters are legal for non-type template?

A. 1
B. 2
C. 3
D. 4

View Answer


6. How many kinds of entities are directly parameterized in c++?

A. 1
B. 2
C. 3
D. 4

View Answer


7.From where does the template class derived?

A. Regular non-templated C++ class
B. Templated class
C. A or B
D. None of the above

View Answer


8.Can we have overloading of the function templates?

A. Yes
B. No

View Answer


9. A container class is a class whose instances are

A. Containers
B. Functions
C. Strings
D. None of the above

View Answer


10.Which of the things does not require instantiation?

A. Functions
B. Non virtual member function
C. Member class
D. All of the above

View Answer






Also check :


Discussion


* You must be logged in to add comment.