我正在尝试打印链接文本中提到的单链表的列表.它工作,但我得到编译器警告:
Initialization discards qualifiers from pointer target type
(关于start = head的声明)和
return discards qualifiers from pointer target type
(在返回语句中)在此代码中:
/* Prints singly linked list and returns head pointer */
LIST *PrintList(const LIST *head)
{
LIST *start = head;
for (; start != NULL; start = start->next)
printf("%15s %d ea\n", head->str, head->count);
return head;
}
Run Code Online (Sandbox Code Playgroud)
我正在使用XCode.有什么想法吗?