Possible Duplicate:
Container Class / Library for C
One of the primary reasons to use C++ over C is the superbly convenient containers that STL provides. However, if I want to write my code in pure C and not have to write all my containers from scratch, what alternative do I have ?
Some of the ones that I have heard of (but never used) are
Any opinions and/or experiences with containers in pure C (Ansi or otherwise) would be much appreciated.
C can't have an "exact equivalent" of STL because C doesn't have templates or classes.
Types of STL Container in C++ In C++, there are generally 3 kinds of STL containers: Sequential Containers. Associative Containers. Unordered Associative Containers.
A container is an object that stores a collection of elements (i.e. other objects). Each of these containers manages the storage space for their elements and provides access to each element through iterators and/or member functions.
An STL container is a collection of objects of the same type (the elements). Container owns the elements. Creation and destruction is controlled by the container.
I'd recommend GLib solely because it's got a nice set of features and it's relatively mature, stable, portable, and widely used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With