Glib庫常用数据结构.docVIP

  • 15
  • 0
  • 约5.82万字
  • 约 57页
  • 2017-01-19 发布于重庆
  • 举报
Glib庫常用数据结构

Glib常用数据结构(1) 2010-01-05 18:59int main(int argc, char** argv) { GSList* list = NULL; list = g_slist_append(list, second); list = g_slist_prepend(list, first); g_printf(The list is now %d items long\n, g_slist_length(list)); list = g_slist_remove(list, first); g_g_printf(The list is now %d items long\n, g_slist_length(list)); g_slist_free(list); return 0; } ***** Output ***** The list is now 2 items long The list is now 1 items long 这段代码中大部分看起来都比较熟悉,不过有一些地方需要考虑; * 如果调用 g_slist_remove 时传递了一个并不在列表中的条目,那么列表将不会发生变化。 * g_slist_remove 也会返回列表的新起始位置。 * 可以发现,“first”是调用 g_slist_prepend 添加的。这是个调用比 g

文档评论(0)

1亿VIP精品文档

相关文档