| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
openkk
12年前发布

C语言哈希表 uthash

     <p>uthash 是一个C语言的哈希表,支持各种结构类型的存储、添加、删除,这些操作都在固定的时间完成,跟哈希表本身的大小无关。键也可以是任何类型的数据。</p>    <p>示例代码:</p>    <pre class="brush:cpp; toolbar: true; auto-links: false;">#include "uthash.h"  struct my_struct {     int id;            /* we'll use this field as the key */     char name[10];                  UT_hash_handle hh; /* makes this structure hashable */ };  struct my_struct *users = NULL;  void add_user(struct my_struct *s) {     HASH_ADD_INT( users, id, s );     }</pre>    <p><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1325143958405" target="_blank">http://www.open-open.com/lib/view/home/1325143958405</a></p>    <p></p>     
 本文由用户 openkk 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
 转载本站原创文章,请注明出处,并保留原始链接、图片水印。
 本站是一个以用户分享为主的开源技术平台,欢迎各类分享!
 本文地址:https://www.open-open.com/lib/view/open1325143958405.html
C语言 C/C++开发