首页 > 代码库 > 无表头单链表的总结----输出链表

无表头单链表的总结----输出链表

#include"head.h"
void print(struct Student* head)
{
    struct Student *p;
    printf("There are %d records:\n", sum);
    p = head;
    if (p != NULL)
    {
        do
        {
            printf("%ld %d\n", p->num, p->score);
            p = p->next;
        } while (p != NULL);   //以链表结尾的NULL为终止条件
    }
}

 

无表头单链表的总结----输出链表