//遍历队列,输出数据
TAILQ_FOREACH(curr, &queueHead, entries) {
printf("%d\n", curr->data);
}
//从头部删除,出队
p = TAILQ_FIRST(&queueHead);
TAILQ_REMOVE(&queueHead, p, entries);
//输出队列尾部元素
p = TAILQ_LAST(&queueHead, queue_s) {
printf("%d\n", p->data);
温馨提示:内容为网友见解,仅供参考