Open KatharinaLin opened 8 years ago
@KatharinaLin
What if m_head is NULL and you call m_head->prev = NULL ? Runtime error must be reported.
while (m != NULL) {
p = new DouListNode(m->elem, NULL, NULL);
if (m == src.m_head) m_head = p;
if (m != src.m_head) {
r->next = p;
p->prev = r;
}
r = p;
p = p->next;
}
You never update m in the loop.........m will never be NULL....
…a low level bug..I used to use p..this time use m.....My fault.....😭……thanks for answering my foolish question 😭
I'm struggling to find that some problems on memory error, though I have solved it , but I can not understand why.Can you help me? why I add
m_head->prev = NULL;
It has no memory problem but it can not run. Another one...I don't understand why this has no memory problem but can not run.(memory limit exceed 32MB for the two problems above.I'm sure only these two, because I passed after I fixed the the two.