mirror of
https://github.com/krahets/hello-algo.git
synced 2026-02-11 06:35:39 +08:00
Add destructors to the C++ codes.
This commit is contained in:
@@ -324,6 +324,9 @@ comments: true
|
||||
stackTop = nullptr;
|
||||
stkSize = 0;
|
||||
}
|
||||
~LinkedListStack() {
|
||||
freeMemoryLinkedList(stackTop);
|
||||
}
|
||||
/* 获取栈的长度 */
|
||||
int size() {
|
||||
return stkSize;
|
||||
|
||||
Reference in New Issue
Block a user