Abhash Kumar Singh Abhash Kumar Singh - 1 year ago 95
C++ Question

What is C# equivalent of <map> in C++?

I have defined a class myComplex. I need to map it to integers. In C++ I would have created a map as


How to do such thing in C#?

Answer Source

The equivalent would be class SortedDictionary<TKey, TValue> in the System.Collections.Generic namespace.

If you don't care about the order the class Dictionary<TKey, TValue> in the System.Collections.Generic namespace would probably be sufficient.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download