正在加载图片...
插入结点的函数 insert如下: student *insert student *head) student*p0, pl, p2; pl-head;/pl指向第一个结点* p= new student;/p0指向要插入的结点* cout<<input all message\n cin>>p0->name>>p0->num>>p0->score; 00->next=NULL if(head=NULL)原来是空表* head=p0;使p0指向的结点作为链表第一个结点* 2021/2242021/2/24 14 插入结点的函数insert如下: student *insert ( student *head) { student *p0,*p1,*p2; p1=head; /*p1指向第一个结点*/ p0=new student; /*p0指向要插入的结点*/ cout<<“input all message\n”; cin>>p0->name>>p0->num>>p0->score; p0->next=NULL; if (head==NULL) /*原来是空表*/ head=p0; /*使p0指向的结点作为链表第一个结点*/
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有