Exam 16: Exceptions and Templates

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

The beginning of a function template is marked by a

(Multiple Choice)
4.8/5
(31)

A program may not contain both a "regular" version of a function and a template version of the function.

(True/False)
4.7/5
(33)

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

(Multiple Choice)
4.9/5
(30)

If an exception is thrown by a member function of a class object, the class __________ is called.

(Multiple Choice)
4.9/5
(36)

A(n) __________ is a value or an object that signals an error.

(Multiple Choice)
4.8/5
(21)

If you want to catch a bad_alloc exception in a program, you should include

(Multiple Choice)
5.0/5
(34)

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

(True/False)
4.8/5
(36)

Class templates allow you to create one general version of a class without having to

(Multiple Choice)
4.8/5
(35)

A function template prefix is placed before the function header while a class template prefix is placed

(Multiple Choice)
4.9/5
(28)

What does the T represent in the following statement? Template < class T >

(Multiple Choice)
5.0/5
(41)

The try/catch/throw construct is able to handle only one type of exception in a try block.

(True/False)
4.7/5
(33)

An exception thrown from outside a try block will

(Multiple Choice)
4.7/5
(34)

In the following code, which statement is the throw point? double divide(int numer, int denom) { If (denom == 0) \quad throw "ERROR: Cannot divide by zero.\n"; else \quad return static_cast<double>(numer)/denom; }

(Multiple Choice)
4.8/5
(29)

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

(Multiple Choice)
4.8/5
(42)

The try block is immediately followed by one or more

(Multiple Choice)
4.8/5
(30)

To handle an exception that has been thrown, a program must have a(n)

(Multiple Choice)
4.9/5
(38)
Showing 21 - 36 of 36
close modal

Filters

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