qLibc通用的 C/C++ 库

联合创作 · 2023-09-28 19:36

qLibc 项目的目的就是提供一个通用的 C/C++ 库,包括所有种类的容器和常用工具函数。

特性:

示例代码:

// 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("%d\n", *px);             
        free(px);
}
 
// release table
tbl->free(tbl);
浏览 5
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报