Which of the following is true of function templates?

a. All function templates begin with the keyword class.
b. Every formal type parameter is preceded by either keyword typename or template.
c. Formal type parameters act as placeholders for built-in types or user-defined types and are used to specify the types of arguments to the function, to specify the return type of the function, and to declare variables within the body of the function definition.
d. A programmer must define a separate function template for each template function specialization to be used in the program.


c. Formal type parameters act as placeholders for built-in types or user-defined types and are used to specify the types of arguments to the function, to specify the return type of the function, and to declare variables within the body of the function definition.

Computer Science & Information Technology

You might also like to view...

The ________ performs arithmetic and logic operations

Fill in the blank(s) with correct word

Computer Science & Information Technology

You use the ____ command to check an ext2, ext3, or ext4 file system for bad data blocks.

A. badblocks B. hdparm C. tune2fs D. e2fsck

Computer Science & Information Technology

Buttons where one click turns a feature off and another click turns it on, are called ________ buttons

A) switch B) option C) toggle D) on/off

Computer Science & Information Technology

Create a more sophisticated Rectangle class than the one you created in Exercise 7.6. This class stores only the x-y coordinates of the upper left-hand and lower right-hand corners of the rect- angle. The constructor calls a set function that accepts two tuples of coordinates and verifies that each of these is in the first quadrant, with no single x or y coordinate larger than 20.0. Methods

calculate the length, width, perimeter and area. The length is the larger of the two dimensions. In- clude a predicate method isSquare that determines whether the rectangle is a square. Write a driver program to test the class. What will be an ideal response?

Computer Science & Information Technology