Cant Figure Errors Attached Code Testtemplatescpp Demonstrate Function Template Finds Maxi Q37268122

I cant figure these errors. I attached the code below

凶 amax: no matching overloaded function found TsafeArray amax(TsafeArray,TsafeArray): template parameter TsafeArray is amb

// TestTemplates.cpp
// Demonstrate function template that finds maximum value inarray.
// Uses Distance class which overloads required operator.

#include <iostream>
#include <fstream>
#include <process.h> //for exit()

using namespace std;

#include “Distance.h”
#include “SafeArray.h”
#include “ArrayIndexOutOfBounds.h”

//*********************************************************
// TODO: Replace these 5 overloaded function declarations
// with 1 function template declaration.
//*********************************************************
template <class TsafeArray>
TsafeArray amax(TsafeArray arr, TsafeArray size);

/*
char amax(char* arr, int size);
int amax(int* arr, int size);
long amax(long* arr, int size);
double amax(double* arr, int size);
Distance amax(Distance* arr, int size);*/

//————————————————————–

int main()
{

   char chrArr[5] = { ‘r’,’f’,’s’,’d’,’n’ };
   int intArr[7]

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.