In the following function template, what must be true in order to use the function with a given data type?

template
int smallest( T array[], int size)
{
int small=0, i;
for(i=0;i {
if(array[i] < array[small])
small=i;
}
return small;
}
a. the data type must be a pre-defined data type
b. the data type must have a < operator defined for it
c. the data type must be numeric
d. the data type must be character based

b. the data type must have a < operator defined for it

Computer Science & Information Technology

You might also like to view...

The enumeration FileAccess is used to ________.

a) control future users’ access to a file b) control program access to a file c) control the amount of updating that can be done on a file at once d) FileAccess is a method, not an enumeration.

Computer Science & Information Technology

?A(n) _________element is contained at the bottom of eacharticleelement and the content provided in thiselement gives more information pertaining to that particular article.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology