onez

onez

  • NA
  • 73
  • 0

Multiple type parameters and return values

Sep 11 2004 10:12 PM
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; }

Answers (2)