Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为何slist_tail_pop 或slist_head_pop 弹出元素后默认会从列表中删除掉? #843

Open
ytchw101 opened this issue Jun 21, 2023 · 1 comment

Comments

@ytchw101
Copy link

能否加个参数指定是否删除?

@xianjimli
Copy link
Member

好的,谢谢。

增加了两个函数。

/**
 * @method slist_tail
 * 返回最后一个元素。
 * @param {slist_t*} slist 单向链表对象。
 *
 * @return {void*} 成功返回最后一个元素,失败返回NULL。
 */
void* slist_tail(slist_t* slist);

/**
 * @method slist_head
 * 返回第一个元素。
 * @param {slist_t*} slist 单向链表对象。
 *
 * @return {void*} 成功返回最后一个元素,失败返回NULL。
 */
void* slist_head(slist_t* slist);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants