标题:关于链表的问题
取消只看楼主
msl12
Rank: 1
等 级:新手上路
帖 子:152
专家分:0
注 册:2015-2-6
结帖率:25%
 问题点数:0 回复次数:1 
关于链表的问题
# include <stdio.h>
# include <string.h>

struct Student
{
    char name[10];
    double score;
    Student * next;
};

int main(void)
{
    Student stu1, stu2, stu3, * head, *q;
    strcpy(stu1.name, "Wang");
    strcpy(stu2.name, "Guo");
    strcpy(stu3.name, "Mo");
    stu1.score=66.6, stu2.score=33.3, stu3.score=98.9;
    head=&stu1, stu1.next=&stu2, stu2.next=&stu3, stu3.next=NULL;
    q=head;
    for (;q!=NULL;q=q->next)//如果这里没有“q!=NULL”会怎样?
        printf("%s's score is %.2lf.\n", q->name, q->score);
    printf("\n");

    return 0;
}
搜索更多相关主题的帖子: include double 
2015-03-22 10:29
msl12
Rank: 1
等 级:新手上路
帖 子:152
专家分:0
注 册:2015-2-6
得分:0 
回复 3楼 n0noper
搜嘎~生动形象
2015-04-06 16:08



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-442919-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 2.216729 second(s), 10 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved