现在的位置: 首页 > 综合 > 正文

C:链表的操作(二),如何输出一个链表

2013年09月08日 ⁄ 综合 ⁄ 共 226字 ⁄ 字号 评论关闭

废话不说,直接跟上以前的代码,写出打印函数来。

void print(struct student *head)
{
struct student *p;
printf(“\n these %d records are:\n”,n);
p = head;
if(head != NULL)
do
{
printf(“%ld %f\n”,p->num,p->score);
p = p->next;
}while(p != NULL);
}

很简单,效果跟上一篇一样,那个也是通过这个函数打印出来的,

请关注 断肠人空间

抱歉!评论已关闭.