C++教程:链表类

2020-01-06 12:22:49于丽

   {
      if(ptemp->readc()==c)
      {
         pcurrent=ptemp;
         return true;
      }
      ptemp=ptemp->readn();
   }
   return false;
}
bool Linklist::Insert(int i,char c)
{
   if(pcurrent!=NULL)
   {
      Node * temp=new Node(i,c,pcurrent,pcurrent->readn());//调用Node类构造函数重载2
      if (pcurrent->readn()!=NULL)
      {
         pcurrent->readn()->setp(temp);
      }