处理列表(List)的的高效C语言库 SimCList
fmms
13年前
<p>SimCList 是一个用来处理列表(List)的的高效C库。内置很多基于列表的算法,例如排序、查找、随机处理等等。</p> <p>下面是一段使用SimCList的示例代码:</p> <pre class="brush:cpp; toolbar: true; auto-links: false;">#include <stdio.h> #include <simclist.h> /* use the SimCList library */ int main() { list_t mylist; /* declare a list */ int userval; list_init(& mylist); /* initialize the list */ printf("Insert your number: "); scanf("%d", & userval); list_append(& mylist, & userval); /* add an element to the list */ printf("The list now holds %u elements.\n", \ list_size(& mylist)); /* get the size of the list */ printf("Your number was: %d\n", \ * (int*)list_get_at(& mylist, 0)); /* extract the first element of the list */ list_destroy(&mylist); return 0; }</pre> <p><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1326936217374" target="_blank">http://www.open-open.com/lib/view/home/1326936217374</a></p> <p></p>