Exam 16: Exceptions, Templates, and the Standard Template Library Stl

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

The Standard Template Library (STL) contains templates for useful algorithms and data structures.

Free
(True/False)
4.9/5
(33)
Correct Answer:
Verified

True

An exception is a condition that can be caused by a syntax error in the program.

Free
(True/False)
4.8/5
(38)
Correct Answer:
Verified

False

A(n) ________ is like a pointer. It is used to access the individual data elements in a container.

Free
(Multiple Choice)
4.8/5
(32)
Correct Answer:
Verified

D

The algorithms provided by the STL are implemented as ________, and perform various operations on elements of containers.

(Multiple Choice)
4.8/5
(34)

In a function template, the programmer substitutes ________ for ________.

(Multiple Choice)
4.8/5
(40)

Non-template functions have a slight advantage in speed over template functions.

(True/False)
4.8/5
(32)

A sequential container organizes data in a sequential fashion, similar to an array or linked list.

(True/False)
4.8/5
(34)

Two types of container classes in the STL are

(Multiple Choice)
4.8/5
(37)

A function template's prefix contains ________ in angled brackets.

(Multiple Choice)
4.9/5
(33)

To catch an exception, a program must

(Multiple Choice)
4.9/5
(34)

Types of iterators are

(Multiple Choice)
4.8/5
(33)

Function templates allow you to write a single function definition that works with many different data types.

(True/False)
4.9/5
(37)

A program may not contain a "regular" version of a function and a template version of the function at the same time.

(True/False)
4.8/5
(28)

Using a function template often requires writing less code than overloading a function.

(True/False)
4.9/5
(43)

A catch block serves as

(Multiple Choice)
4.9/5
(35)

The bad_alloc exception is thrown

(Multiple Choice)
4.8/5
(39)

A(n) ________ is used in a function template to specify a generic data type.

(Multiple Choice)
4.7/5
(42)

In the statement template <class T>, what does the word class indicate?

(Multiple Choice)
4.8/5
(33)

The C++ mechanism for exception handling encloses code that might throw an exception in a try block and puts exception handling code in catch blocks attached to the try block.

(True/False)
4.8/5
(26)

When an error occurs, an exception is

(Multiple Choice)
4.7/5
(34)
Showing 1 - 20 of 40
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)