Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I have defined a class myComplex. I need to map it to integers. In C++ I would have created a map as map<myComplex,int> first;

How to do such thing in C#?

like image 686
Abhash Kumar Singh Avatar asked Jan 17 '14 10:01

Abhash Kumar Singh


People also ask

What is meant by C?

noun plural c's, C's or Cs. the third letter and second consonant of the modern English alphabet. a speech sound represented by this letter, in English usually either a voiceless alveolar fricative, as in cigar, or a voiceless velar stop, as in case.

What is C and why it is used?

C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...

What is C and C++ difference?

Conclusion. In a nutshell, the main difference between C and C++ is that C is a procedural with no support for objects and classes whereas C++ is a combination of procedural and object-oriented programming languages.


1 Answers

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.

like image 170
dalle Avatar answered Oct 02 '22 06:10

dalle