当前位置: 软件>C/C++软件
通用的 C/C++ 库 qLibc
本文导语: qLibc 项目的目的就是提供一个通用的 C/C++ 库,包括所有种类的容器和常用工具函数。 特性: General Containers. List — Doubly Linked List. List Table — KEY/VALUE paired table implemented on linked-list. Hash Table — Hash based KEY/VALUE paired table...
qLibc 项目的目的就是提供一个通用的 C/C++ 库,包括所有种类的容器和常用工具函数。
特性:
- General Containers.
- List — Doubly Linked List.
- List Table — KEY/VALUE paired table implemented on linked-list.
- Hash Table — Hash based KEY/VALUE paired table.
- Static Hash Table — Static(array/mmapped/shared) memory based KEY/VALUE paired table.
- Vector — implements a growable array of elements.
- Queue — FIFO(First In First Out) implementation.
- Stack — LIFO(Last In First Out) implementation.
- General utilities.
- Extensions.
示例代码:
// create a hash-table with hash range 100.
// Hash range does NOT mean maximum number of elements. Refer API doc.
qhashtbl_t *tbl = qhashtbl(100);
// add an element which key name is "score".
int x = 12345;
tbl->put(tbl, "score", &x, sizeof(int));
// get the value of the element.
int *px = tbl->get(tbl, "score", NULL, true);
if(px != NULL) {
printf("%dn", *px);
free(px);
}
// release table
tbl->free(tbl);
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。