链表的学习

来源:互联网 发布:手机网络故障诊断 编辑:程序博客网 时间:2024/06/10 00:05
#include <stdio.h>#include <stdlib.h>typedef struct tagInf{    char name[10];    unsigned int age;}Information;typedef struct tagPeo{    Information inf;    struct tagPeo *next;}People;int main(){    Information *inf;    inf=(Information *)malloc(sizeof(Information));    printf("Please enter some information (name age)\n");    scanf("%s %d",inf->name,&inf->age);    printf("%s %d",inf->name,inf->age);    free(inf);    return 0;}


上面的程序构造了简单的链表。

 

0 0
原创粉丝点击