done

removed
Last edited on
Well, the first error message is telling you that you have two identical function templates (see lines 14 and 19).

Unfortunately, there are a few other alarming things going on in functions.h. It appears that you were to create the follow function templates:

min
count
sum
myswap

They are supposed to be generic enough to accept both integers and doubles for each of the operations.

ARRLEN is not in the scope of functions.h. It is being used as a formal parameter name, which might be a little misleading.


1
2
3
4
5
template <class T> 
T myswap(T& a, T& b) 
{
  T c(a); a=b; b=c;
}

myswap looks good except it should not return anything.

Take each of the functions and think for a minute about the inputs and outputs. That will help you get the signatures right.
Last edited on
Topic archived. No new replies allowed.