Skip to content

DestroyList(L); error #2

@stlrcp

Description

@stlrcp

大佬,单向链表的销毁链表是不是有问题啊
int main()
{
int N = 10;
Lnode* L;
cout << "temp" << endl;
InitList(L);
cout << L << endl;
// CreateListHead(L, 3);
CreateListTail(L, 3);
cout << L->next->data << endl;
// cout << L->next + 1<< endl;
// cout << L->next->data<< endl;
cout << IsEmpty(L) << endl;
DestroyList(L);
cout << IsEmpty(L) << endl;

return 0;

}
执行的时候,到 DestroyList(L); 的时候直接core dump退出了

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions