I want to use a stack in C, anybody recommend a library?
For example for a hash table I used UThash.
Thanks!
I want to use a stack in C, anybody recommend a library?
For example for a hash table I used UThash.
Thanks!
If you can fudge it a bit and use C++, Qt is a really great library with a lot of basic data structures.
Here is a similar question:
And here is CCAN, C's equivalent to CPAN:
Stack implementation fits in single sheet of paper.
That's simplest stack example
int stack[1000];
int *sp;
#define push(sp, n) (*((sp)++) = (n))
#define pop(sp) (*--(sp))
...
{
sp = stack; /* initialize */
push(sp, 10);
x = pop(sp);
}