首页 > 学院 > 开发设计 > 正文

菜鸟图解简单链表

2019-11-17 05:26:41
字体:
来源:转载
供稿:网友

  代码:

#include <stdio.h>
{
long num;
float score;
strUCt student *next;
};

int main()
{
struct student a, b, c, *next, *p;

a.num = 99101; a.score = 89.5;
b.num = 99103; b.score = 90;
c.num = 99107; c.score = 85;

head = &a;
a.next = &b;
b.next = &c;
c.next = NULL;
p = head;

do
{
PRintf("%ld %5.1f/n", p ->num, p ->score);
p = p -> next;
}
while ( p != NULL);
}


[myimg]upload/005_205.png[/myimg]

[myimg]upload/004_170.png[/myimg]

[myimg]upload/003_195.png[/myimg]

[myimg]upload/002_207.png[/myimg]

[myimg]upload/001_208.png[/myimg]

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表