int main() { }
void addTotail(ListNode *& pHead, int value) { ListNode *node = new ListNode(); node->value = value; node->pNext = NULL; ListNode *p = pHead; if (p == NULL) { pHead = node; return; } while (p->pNext != NULL) { p = p->pNext; } p->pNext = node; }
原文地址:http://www.cnblogs.com/zjgtan/p/3840930.html