【发布时间】:2015-05-12 17:26:19
【问题描述】:
我正在尝试在我的代码中实现这个功能
Check QUEUEdelete_check(Q q, int refc){
link *temp;
*temp = q->head;
if(temp->check.refc == refc)
q->head = temp->next;
free(temp);
return temp->check;
while(temp->next != NULL){
if (temp->next->check.refc == refc){
temp->next = temp->next->next;
if(temp->next == NULL)
q->tail = temp;
free(temp->next);
return temp->check;
}
temp = temp->next;
}
printf("Cheque %ld does not exist", refc); }
它给了我这个错误:
Queue.c:在函数“QUEUEdelete_check”中: Queue.c:49:12:错误:请求成员“检查”不是结构或联合
还有下一个
Queue.c:50:23: 错误:在不是结构或联合的东西中请求成员‘next’ q->head = temp->next; if(temp->check.refc == refc)
我使用的结构是:
typedef struct queue{ link head; link tail;} *Q;
typedef struct node{Check check ;struct node *next; } *link;
typedef struct Check{long int amount, refe, refb, refc;}Check;
【问题讨论】:
标签: c