Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Good STL-like library for C [closed]

What are good libraries for C with datastructures like vectors, deques, stacks, hashmaps, treemaps, sets, etc.? Plain C, please, and platform-independent.

like image 376
Michiel de Mare Avatar asked Aug 05 '08 16:08

Michiel de Mare


People also ask

Is there an STL library for C?

C can't have an "exact equivalent" of STL because C doesn't have templates or classes. You might be interested in the "Glib collections" library: http://www.ibm.com/developerworks/linux/tutorials/l-glib/

Is there a vector library in C?

C Vector Library A simple vector library for C. This libary's vectors work in a similar manner to C++ vectors: they can store any type, their elements can be accessed via the [] operator, and elements may be added or removed with simple library calls.

Does Java have STL?

Both C++ and Java have libraries that let us implement common data structures. C++ has STL, the Standard Template Library, and Java has the Collections classes.


2 Answers

The Glib library used on the Gnome project may also be some use. Moreover it is pretty well tested.

IBM developer works has a good tutorial on its use: Manage C data using the GLib collections

like image 113
Brendan Avatar answered Oct 08 '22 05:10

Brendan


As always, Google is your friend:

http://nixbit.com/cat/programming/libraries/c-generic-library/

specifically:

http://nixbit.com/cat/programming/libraries/generic-data-structures-library/

like image 29
Stu Avatar answered Oct 08 '22 05:10

Stu