Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有一个队列数据结构。
Queue()
以下是否会造成任何内存泄漏:
Queue* test = new Queue(); Queue* test1 = test; delete test1;
不,但你会留下 2 个悬空指针 -test和test1. 在它们指向有意义的东西之前,您不能再使用它们。
test
test1