我想在C中使用堆栈,有没有人推荐一个库?
例如,对于哈希表,我使用了UThash。
谢谢!
发布于 2010-10-26 00:08:16
下面是一个类似的问题:
Are there any open source C libraries with common data structures?
下面是CCAN,C相当于CPAN:
http://ccan.ozlabs.org/
发布于 2010-10-26 21:23:42
堆栈实现适合一张纸。
这是最简单的堆栈示例
int stack[1000];
int *sp;
#define push(sp, n) (*((sp)++) = (n))
#define pop(sp) (*--(sp))
...
{
sp = stack; /* initialize */
push(sp, 10);
x = pop(sp);
}发布于 2010-10-26 00:04:49
如果你可以稍微修改一下并使用C++,Qt是一个非常棒的库,它有很多基本的数据结构。
https://stackoverflow.com/questions/4016383
复制相似问题