[英]How to print the contents of a doubly-linked list?
如何使用/include/linux/list.h
定义的list.h
打印列表值?
像这样的东西:
struct list_head head; /* previously initialized */
struct list_head *pos;
list_for_each(pos, head)
{
your_type *elt;
elt = list_entry(pos, typeof(*elt), name_of_list_head_struct_member);
/* and print *elt! */
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.