Saturday, May 9, 2009

What are C# analogues of the C++ STL?

I suppose C# has default classes for basic data structures in a way similar to that of the STL for C++. What are they and where can I get information about them?

What are C# analogues of the C++ STL?
C# is more closely related to Java than C++. Each of the standard classes can be found by some using declaration on the System set of classes.





For instance System.Collections.Generic would give you access to Stacks, Lists, and Arrays.
Reply:Yeah, the System.Collections and System.Collections.Generics namespaces are what you are looking for. Generics are more powerful than template classes, you can put constraints on the type parameters and they have better compile time error checking.


No comments:

Post a Comment