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
(76)
Correct Answer:
Verified

True

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

Free
(True/False)
4.7/5
(86)
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
(69)
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
(80)

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

(Multiple Choice)
4.8/5
(89)

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

(True/False)
4.8/5
(77)

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

(True/False)
4.8/5
(80)

Two types of container classes in the STL are

(Multiple Choice)
4.8/5
(83)

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

(Multiple Choice)
4.9/5
(83)

To catch an exception, a program must

(Multiple Choice)
4.8/5
(80)

Types of iterators are

(Multiple Choice)
4.8/5
(81)

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

(True/False)
4.9/5
(88)

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.9/5
(73)

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

(True/False)
4.9/5
(84)

A catch block serves as

(Multiple Choice)
4.9/5
(75)

The bad_alloc exception is thrown

(Multiple Choice)
4.8/5
(79)

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

(Multiple Choice)
4.7/5
(82)

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

(Multiple Choice)
4.8/5
(77)

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
(70)

When an error occurs, an exception is

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

Filters

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