69,373
社区成员
发帖
与我相关
我的任务
分享
LinkList* InsertLinkListhead(LinkList* head)
{
LinkList *newhead;
newhead= (LinkList*)malloc(sizeof(LinkList));
printf("请输入你要插入的链表节点的数:\n");
scanf("%d", &(newhead->data));
if (head == NULL)
{
head = newhead;
return head;
}
else
{
newhead->next = head;
head = newhead;
}
return head;
void PrintLinkList(LinkList* head)
{
while (head != NULL)
{
printf("%d ", head->data);
head = head->next;
}
puts("");
}