Algorithm_fromBilibili icon indicating copy to clipboard operation
Algorithm_fromBilibili copied to clipboard

DestroyList(L); error

Open stlrcp opened this issue 2 years ago • 0 comments

大佬,单向链表的销毁链表是不是有问题啊 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退出了

stlrcp avatar Nov 04 '22 09:11 stlrcp