I’m working on improving my skills in other languages, coming from using c++ as my primary programming language. My current project is hammering down C#.net, as I have heard it is a good in-between language for one who knows both c++ and VB.net.
Typically when working with an unknown number of elements in c++ I would declare my variable as a vector and just go from there. Vectors don’t seem to exist in c#, and in my current program I have been using arraylists instead, but I’m starting to wonder if it’s a good habit to use arraylists as I read somewhere that it was a carryover from .net 1.0
Long question short- what is the most commonly used listing type for c#?
If you target pre .NET 2.0 versions, use
ArrayListIf you target .NET 2.0+ then use generic type
List<T>You may need to find replacements for other C++ standard containers, so here is possible mapping of C++ to .NET 2.0+ similar types or equivalents: