Question: Write a template function max5() that takes as its argument an array of five items of type T and returns the largest item in the
Write a template function max5() that takes as its argument an array of five items of type T and returns the largest item in the array. (Because the size is fixed, it can be hard-coded into the loop instead of being passed as an argument.) Test it in a program that uses the function with an array of five int value and an array of five double values.
Step by Step Solution
3.39 Rating (158 Votes )
There are 3 Steps involved in it
array of 5 double values ... View full answer
Get step-by-step solutions from verified subject matter experts
