📜  将项目添加到链表的开头 - C 编程语言代码示例

📅  最后修改于: 2022-03-11 15:04:40.195000             🧑  作者: Mango

代码示例1
void push(node_t ** head, int val) {
    node_t * new_node;
    new_node = (node_t *) malloc(sizeof(node_t));

    new_node->val = val;
    new_node->next = *head;
    *head = new_node;
}