Question: Consider the definition of the following function template: template void funcExp(Type list[], int size) { Type x = list[0]; Type y = list[size - 1];

Consider the definition of the following function template:

template void funcExp(Type list[], int size) { Type x = list[0]; Type y = list[size - 1]; for (int j = 1; j < size; j++) { if (x < list[j]) x = list[j]; if (y > list[size - 1 -j]) y = list[size - 1 -j]; } cout << x << endl; cout << y << endl; }

Explain the meaning and functionalities of this program. Test it with the following data:

int list[10] = {5,13,11,10,4,19,45,3,61,2}; string strList[] = {"One", "Two", "Three", "Four", "Five", "Six"};

Run the code in an IDE with necessary declarations and a main function to show theoutput of the following statements? a. funcExp(list, 19); b. funcExp(strList, "Seven");

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!