Click here to Skip to main content
15,746,083 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a dictionary say:

Dictionary<int,> ListPPM = new Dictionary<int,>();
ListPPM.Add(1, 445.1242);
ListPPM.Add(4, 445.1992);
ListPPM.Add(7, 445.1205);
ListPPM.Add(22, 445.1205);
ListPPM.Add(32, 445.1242);
ListPPM.Add(34, 445.1992);
ListPPM.Add(100, 445.1205);
ListPPM.Add(157, 445.1205);

S0 ListPPM[4] = {32,445.1242}

Now I want to access the 5th element (index 4) of the dictionary that contains key, value pairs {32,445.1242}
The I want to parse it like int key = 32
double value = 445.1242

1 solution

You can't because there's no guarantee the items will be in the same porder as they were inserted. What I think you want to use instead is an OrderedDictionary.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900