静态链表输出有误,为什么?

#include "stdio.h"

 struct student

    {

    long num;

    float score;

    struct student * next;

    };

void main()

{

    struct student stu1,stu2,stu3;

    struct student * head,*p;

    

    stu1.num=1;stu1.score=2;http://img.mukewang.com/5878c6610001566705160475.jpg

    stu2.num=2;stu2.score=2;

    stu3.num=3;stu3.score=2;

    head=&stu1;

    stu1.next=&stu2;

    stu2.next=&stu3;

    stu3.next=NULL;

    p=head;

    while(p!=NULL){

    printf("%d  %d",p->num,p->score);

    p=p->next;

    }

   }


溯源1
浏览 1094回答 1
1回答

快乐的时光

希望对你有所帮助
打开App,查看更多内容
随时随地看视频慕课网APP