A
Alex
Hello everybody,
I’m new to C# and have a very general question. In my C++ project I’m
widely using STL library to work with vectors and maps. As I
understand C# arrays allow me to have something like vectors, i.e. I
can create some class “MyClass” and declare array
MyClass[] ar_myclasses;
And here is my question – is in C# something similar to STL maps? I
mean can I have some class, where some “key” will point to some
element of some class. Let’s say
MapClass1:
[key1] -> [string1]
[key2] -> [string2]
[key3] -> [string3]
………………………
or in my case
MapClass2:
[key1] -> [myclass1, myclass2, myclass3…]
[key2] -> [myclass4, myclass5, myclass6…]
[key3] -> [myclass7, myclass8, myclass9…]
…………………….
Regards,
Alex
I’m new to C# and have a very general question. In my C++ project I’m
widely using STL library to work with vectors and maps. As I
understand C# arrays allow me to have something like vectors, i.e. I
can create some class “MyClass” and declare array
MyClass[] ar_myclasses;
And here is my question – is in C# something similar to STL maps? I
mean can I have some class, where some “key” will point to some
element of some class. Let’s say
MapClass1:
[key1] -> [string1]
[key2] -> [string2]
[key3] -> [string3]
………………………
or in my case
MapClass2:
[key1] -> [myclass1, myclass2, myclass3…]
[key2] -> [myclass4, myclass5, myclass6…]
[key3] -> [myclass7, myclass8, myclass9…]
…………………….
Regards,
Alex