onez

onez

  • NA
  • 73
  • 0

Accessing Array values in Hashtable

Aug 19 2004 10:23 PM
I designing a program that runs through a list of stocks, obtains the price, adds the price to an Array and pops off the last price. Then I want to be able to access the array from a hastable (with the symbol as the key) for analysis. But I have no way of accessing the arrays. Maybe there is a better way to go about this? Thanks. double[] A1 = { 5.05, 5.33, 5.66, 5.22, 5.49 }; double[] A2 = { 6.55, 7.33, 6.96, 7.22, 8.49 }; Hashtable H = new Hashtable(); H.Add("A1", A1); H.Add("A2", A2); Console.WriteLine("TYPE: " + HHH["A1"].GetType()); // this returns System.Double[] so why doesn't this work? : double[] G = HHH["A1"]; or object[]G = HHH["A1"];

Answers (1)