我在 C 中使用单链表,没有指向节点值的指针。所以,而不是:
struct _node
{
struct _node * next;
void* value;
} node;
我有
struct _node
{
struct _node * next;
} node;
这样的列表有特殊名称吗?
编辑:
只是为了解释为什么这些列表很有用(我真的不明白为什么不赞成):
struct
{
node node;
int i;
} s;
当我这样做时,我强制 struct s 有一个节点,但不必设置 void* 值。
我正在使用这个方案来保存我的任务信息,这些信息将在 FIFO 列表中。