我正在处理链接列表,并且存在移动到链接列表的下一个元素的问题。我得到的错误是: error: incompatible types when assigning to type 'item' from type 'struct item *
尝试移动到链接列表的下一个元素时出错
下面是代码:
typedef struct item
{
float size;
struct item *next;
} item;
item head, curr, tail;
...
head.next = (item*) malloc(sizeof(item));
curr = head.next;
感谢您的帮助。