2
Answers

Multiple type parameters and return values

onez

onez

20y
1.9k
1
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)