Multiple type parameters and return values
This class returns a max double value out of a double array. I would like to enter any type of numerical array and return the max. I remember a C++ code that involving putting a T in front of 'type' or something that was real easy.
public static double ReturnMax(ArrayList Values)
{
int c = 0;
double Max = 0; double Val;
while (c < Values.Count)
{
Val = Convert.ToDouble(Values[c]);
if (Val > Max)
{
Max = Val;
}
c++;
}
return Max;
}