随笔分类 -  学习交流

摘要:【问题描述】下述Makefile中:all: gcc -Wall -g -DDARRAY_TEST darray.c -o darray_test gcc -Wall -g -DDLIST_TEST dlist.c -o dlist_test gcc -Wall -g -shared darray.c dlist.c linear_container_darray.c linear_container_dlist.c -o libcontainer.so gcc -Wall -g linear_container_test.c -L./ -lcontainer -o container_t.. 阅读全文
posted @ 2012-05-02 10:30 j2ee技术 阅读(240) 评论(0) 推荐(0)
摘要:【问题描述】前一阵子,看通用双向链表实现,一直有个问题,如下:先看代码:static DListNode *dlist_get_node(DList *thiz, size_t index, int fail_return_last){ DListNode *iter = thiz->first; while(iter!=NULL && iter->next!=NULL && index>0) { iter = iter->next; index--; } if(!fail_return_last) { iter = index>0 阅读全文
posted @ 2012-04-22 12:05 j2ee技术 阅读(233) 评论(0) 推荐(0)
摘要:【更新说明】2012-4-22:更新了slist.c中的slist_delete函数实现。【描述】仿照《系统程序员成长计划》通用双链表,写的一个通用单链表。如有错误,欢迎指正。【清单】slist.h#ifndef __SLIST_H__#define __SLIST_H__#ifdef __cplusplusextern "C" {#endifstruct SListNode;struct _SList;typedef struct _SList SList;typedef enum _SListRet{ SLIST_RET_OK, SLIST_RET_ERR_CREATE 阅读全文
posted @ 2012-04-13 10:53 j2ee技术 阅读(219) 评论(0) 推荐(0)
摘要:【本栏目的】学习过程中,遇到的问题,在本栏一一记录,希望可以得到指点,交流学习。【问题描述】有这样一段代码,DListNode *dlist_get_node(DList *thiz, size_t index, int fail_return_last){ DListNode *iter = thiz->fisrt; if(iter!=NULL && iter->next!=NULL && index>0) { iter = iter->next; index--; } if(!fail_return_last) { iter = in 阅读全文
posted @ 2012-04-06 09:38 j2ee技术 阅读(135) 评论(0) 推荐(0)