Algorithm_fromBilibili
Algorithm_fromBilibili copied to clipboard
DestroyList(L); error
大佬,单向链表的销毁链表是不是有问题啊 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退出了