为了账号安全,请及时绑定邮箱和手机立即绑定

我定义了一个链表,和一个node类,里面只有一个整形数据date,和一个指针node指针,运行代码时出现了死循环

我定义了一个链表,和一个node类,里面只有一个整形数据date,和一个指针node指针,运行代码时出现了死循环

C++
C10H16N5O13P3 2017-08-17 01:43:44
bool List:: ListInsertHead(Node *pNode ) { Node *temp = m_pList->next; //m_pList是在链表里的一个Node指针 m_pList->next = NULL; ListInsertTail(pNode); ListInsertTail(temp); m_iLenth++; return true; } bool List::ListInsertTail(Node *pNode) { Node *currentNode = m_pList; while (currentNode ->next!=NULL ) { currentNode = currentNode->next; } ListSetNull(pNode); currentNode->next = pNode; m_iLenth++; return true; } bool List::ListSetNull(Node *pNode) { Node *currentNode = pNode; while (currentNode->next != NULL) { currentNode = currentNode->next; } currentNode->next = NULL; return true; }
查看完整描述

目前暂无任何回答

  • 0 回答
  • 0 关注
  • 1356 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信