Possible Duplicate:
Multi value Dictionary
I just need to store 2 value. How can I do that?
Possible Duplicate:
Multi value Dictionary
I just need to store 2 value. How can I do that?
If you need variable number of values per key, you can use
Dictionary<TypeOfKey, List<TypeOfValue>
E.g. if you want to store an arbitrary number of integers per string, you could do this
var numbersPerString = new Dictionary<string, List<int>>();
Dictionary values can be an arbitrary type, so make the values structs with appropriate members, then you'll be able to store two, or as many as you like.
I don't know if C# has an equivalent to C++ std::pair; you could use that, but a struct might make more sense, then you can say:
dict[person].shoesize
dict[person].eyecolour
Which is nice and readable.