在结构体之外定义的数据类型怎么不能用?
#define status bool;
#define ElemType char;
typedef struct lnode
{
ElemType data;
struct lnode *next;
}lnode,*linklist;
status createlist(linklist &l,int n)
{
l=(linklist)malloc(sizeof(lnode));
if(!l)
return 0;
r=l;
for(i=0;i<n;i++)
{
int x;
cin >>x;
s=(linklist)malloc(sizeof(lnode));
if (!s)
return overflow;
s->data=x;
r->next=s;
r=s;
r->next=null;
}
return 1;
}
----------------------------------------------------------------------
这样的定义会出错
lnode中的data编译错误->no members defined using this type
后面还有很多相关的错误,难道不能这么写?