搜索
您的当前位置:首页正文

34.写一print函数,将链表中的各数据遍历输出

来源:知库网
  void print(student *head )
  {
    student *p;
    cout<<"there"<<n<<"records"<<endl;
    p=head;
    if(head!=NULL)
    do
    {
        cout<<p->num<<" "<<p->score<<endl;
        p=p->next;
    }while(p!=NULL)
  }
Top