C-不兼容的指针in =



我不知道如何解决此错误。我不能分配相同的类型。继续接收'(严格(不兼容的指针in ='

#define POOLSZ 53
typedef struct{
     int eventnr;
     int eventfq;
     struct olnode *next;
}olnode;
olnode pool[POOLSZ];
olnode *avail
void initpool()
{
    int i;
    for(i = 0; i < POOLSZ-1; i++)
        pool[i].next = &pool[i+1]; /*This is the error line */
    pool[i].next = NULL;
    avail = pool;
}

此行是指向struct olnode的指针:

struct olnode *next;

但是您没有定义这样的结构。您只有一个匿名结构, typedef ed to olnode

修复:

typedef struct olnode {...} olnode;

最新更新