源义朝:left of '.data' must have class/struct/union type

来源:百度文库 编辑:高校问答 时间:2024/05/04 05:19:54
编译c++程序时老有这个信息,是怎么回事啊??这是程序的一段代码:
typedef struct Lnode
{
elemtype data;
struct Lnode *next;
}Lnode,*linklist,*link,*position;

int locateelem(linklist &l,term e,int n,status(*cmp)())
{
int i;
linklist p;
l=(linklist)malloc(sizeof(Lnode));
l->next=NULL;
for(i=n;i>0;--i)
{
p=(linklist)malloc(sizeof(Lnode));
scanf("%d",p->data);
p->next=l->next;l->next=p;
}

}