开发者

C data structure library [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. 开发者_开发百科 Closed 10 years ago.

I want to use a stack in C, anybody recommend a library?

For example for a hash table I used UThash.

Thanks!


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);
}


Here is a similar question:

Are there any open source C libraries with common data structures?

And here is CCAN, C's equivalent to CPAN:

http://ccan.ozlabs.org/


If you can fudge it a bit and use C++, Qt is a really great library with a lot of basic data structures.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜