数据结构 typedef的错误 麻烦大佬们看一下
程序代码:
#include <stdio.h> #include <malloc.h> #include <string.h> typedef struct data { int num; int passswd; }data; typedef struct LNode { data; struct LNode *next; }LNode,*LinkList; //LNode == *LinkList == struct LNode void CreatList_L(LinkList *L,int n) { int i = 1; LNode *p,*q,*head; head = p = (LinkList)malloc(sizeof(LNode) ); //Head Node for(i = 1 ; i <= n ; i++) { p.data.num = i; scanf("%d",p.data.passwd); q = (LinkList)malloc(sizeof(LNode) ); p->next = q; p = p->next; } p->next = head; //Circle Link }