Write a template function maxn that takes as its arguments


Problem

Write a template function maxn() that takes as its arguments an array of items of type T and an integer representing the number of elements in the array and that returns the largest item in the array. Test it in a program that uses the function template with an array of six int value and an array of four double values. The program should also include a specialization that takes an array of pointers-to-char as an argument and the number of pointers as a second argument and that returns the address of the longest string. If multiple strings are tied for having the longest length, the function should return the address of the first one tied for longest. Test the specialization with an array of five string pointers.

 

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Write a template function maxn that takes as its arguments
Reference No:- TGS02635194

Expected delivery within 24 Hours