=中的指针不兼容

Ben*_*ose 4 c error-handling

我不知道如何解决这个错误.我不能指定相同的类型.继续接收'(严格)不兼容的指针='

#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;
}
Run Code Online (Sandbox Code Playgroud)

Hol*_*Cat 8

这一行指向struct olnode:

struct olnode *next;
Run Code Online (Sandbox Code Playgroud)

但是你没有定义这样的结构.您只有一个匿名结构,typedefed to olnode.

固定:

typedef struct olnode {...} olnode;
Run Code Online (Sandbox Code Playgroud)