【发布时间】:2021-06-06 10:10:47
【问题描述】:
我想使用递归反向打印列表的元素,但我得到一个执行错误!
有人可以帮忙吗?
typedef struct node
{
int val;
struct node* next;
}node;
typedef struct list
{
node* head;
}list;
void display(list L)
{
if(L.head == NULL) return;
L.head= L.head->next;
display(L);
printf("%d\t",L.head->val);
}
【问题讨论】:
标签: c recursion linked-list