简单链表的一个警告提示,类型不匹配怎么改.
#include "stdio.h"#include "stdlib.h"
struct node
{
int Num;
struct *next;
};
void main()
{
struct node *head,*p,*q;
head=p=q=(struct node *)malloc(sizeof(struct node));
scanf("%d",&p->Num);
while(p->Num!=-1)
{
q=(struct node *)malloc(sizeof(struct node));
scanf("%d",&q->Num);
p->next=q;
p=q;
}
p->next=NULL;
}
VC++6.0编译,有警告提示.类型不符合.应该怎么修改?
warning C4133: '=' : incompatible types - from 'struct node *' to 'struct $S1 *'
上述是一个简单的单向链表。求教.