yii 学习笔记十五、商品信息删除
2014-04-08 20:27
351 查看
Make the tail queue sample in man page work.
#include <sys/queue.h> #include <stdlib.h> #include <stdio.h> int main(int argc, const char *argv[]) { TAILQ_HEAD(tailhead, entry) head; struct tailhead *headp; headp = &head; struct entry { int val; TAILQ_ENTRY(entry) entries; } *n1, *n2, *np; TAILQ_INIT(headp); n1 = malloc(sizeof(struct entry)); n1->val = 10; TAILQ_INSERT_HEAD(headp, n1, entries); n1 = malloc(sizeof(struct entry)); n1->val = 100; TAILQ_INSERT_TAIL(headp, n1, entries); n2 = malloc(sizeof(struct entry)); n2->val = 200; TAILQ_INSERT_AFTER(headp, n1, n2, entries); for (np = headp->tqh_first; np != NULL; np = np->entries.tqe_next) printf("value: %d\n", np->val); while (headp->tqh_first != NULL) TAILQ_REMOVE(headp, headp->tqh_first, entries); return 0; }
相关文章推荐
- rails学习笔记:维护商品信息任务C
- android 学习笔记 数据库的创建, 查询 和删除表内的信息
- yii 学习笔记十三、商品添加,逻辑部分实现
- JSP浏览商品信息项目学习笔记
- yii 学习笔记九、通过模型获得具体数据信息
- Yii学习笔记:进一步简化,提示信息跳转页面
- rails学习笔记:维护商品信息任务A
- yii 学习笔记 十四、商品数据修改
- python3.4学习笔记(十五) 字符串操作(string替换、删除、截取、复制、连接、比较、查找、包含、大小写转换、分割等)
- rails学习笔记:维护商品信息任务B
- Web 在线文件管理器学习笔记与总结(8)删除文件
- 【Rails学习笔记】更新、显示和删除用户(涉及分页)(下)
- 设计模式学习笔记十五:装饰模式(Decorator Pattern)
- Tomcat学习笔记 - 错误日志 - NetBeans配置tomcat出错情况总结 -- 尚未授予访问 Tomcat 服务器的权限。请在服务器管理器的 Tomcat 定制器中设置 "manager-script" 角色的正确用户名和口令。 有关详细信息, 请查看服务器日志。
- JPA学习笔记---JPA数据的操作:增加,删除,修改,获取,使用JPQL进行查询
- 【SQL Server】学习笔记2—插入数据、删除数据、更新数据
- 十五、python class 类学习笔记
- Git学习笔记三--管理修改、撤销修改、删除文件
- 信息安全工程师 学习笔记(十一)
- 信息安全系统设计基础 第4周学习笔记