在下面的代码摘录中,它给了我警告:从不兼容的指针类型分配给指出的两行。我究竟做错了什么?
typedef struct {
char* string;
struct samplelist* nextchunk;
struct samplelist* prevchunk;
} samplelist;
samplelist* startsamplelist;
samplelist* lastsamplelist;
samplelist* newchunk = checked_malloc(sizeof(samplelist));
lastsamplelist->nextchunk = newchunk; //warning here
newchunk->prevchunk = lastsamplelist; // warning here
lastsamplelist = newchunk; //no problem here though
编辑:附上相关定义,下面的答案不依赖于添加的代码。是语法错误