静态链表

    技术2025-05-14  62

    #include<stdio.h> #include<string.h> #include<stdlib.h> typedef struct student { int data; int score; struct student *next; } stu; int main() { stu s1={1,10,NULL}; stu s2={10,30,NULL}; stu s3={20,10,NULL}; s1.next = &s2; s2.next = &s3; s3.next = NULL; struct student *p=NULL; p=&s1; while(p) { printf("%d %d \n",p->data,p->score); p=p->next; } return 0; }

    Processed: 0.010, SQL: 9