The C language is not a piece of software but a defined standard, so one wouldn't say that it's open-source, but rather that it's an open standard. There are a gazillion different compilers for C however, and many of those are indeed open-source.
Stacks are in the C++ standard library.
The C Programming Language has a much smaller Standard Library as compared to other more modern programming languages such as Java or Python. This C Algorithms library provides a basic set of mathematical functions, string manipulation, type conversions, and file and console-based I/O.
C is not an object-oriented language, and it doesn't have standard libraries for things like queues.
BSD queue.h has:
BSD tree.h has:
See the queue(3) and tree(3) man pages for details. I really like them because they are pure C macros without dependencies (not even libc). Plus with the BSD license you don't have to worry about any company restrictions w/ GPL.
Gnome provides an excellent library for this, called Glib, with many useful data structures and other utilities as well.
gnulib, the gnu portability library.
It's distributed as source code. This list is from its module list, which includes a TON of other things. One interesting one is "c-stack: Stack overflow handling, causing program exit."
SGLIB is an excellent generic data-structures library. The library currently provides generic implementations for:
sorting arrays
linked lists
sorted linked lists
double linked lists
red-black trees
hashed containers
It's very fast, faster than glib. It's inspired by the Standard Template Library. Download Here
Another solution is Attractive Chaos software.
C macro library:
kbtree.h: efficient B-tree library in C.
khash.h: fast and light-weighted hash table library in C.
kvec.h: simple vector container in C.
Sglib and Attractive Chaos software are C macros library. Using void* to implement generic containers in C may be inefficient. C macros mimics C++ template and are as efficient as C++ template
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