用链表写排序,编译报错找不出原因

问题遇到的现象和发生背景

这是我写的链表插入排序,但是没法编译过去。我用的乌邦图

问题相关代码,请勿粘贴截图

#include <stdio.h>
#include <stdlib.h>
typedef int ElemType;
typedef struct Node
{
ElemType date;
struct Node next;
}node;
node
create_linkedlist(void)

{
int d;

node *p=NULL;
node *fist=NULL;
node *last=NULL;

while(1)
{
   scanf("%d",&d);
   if(d==0)
    {
        break;
    }
   p=(node *)malloc(sizeof(*p));
   p->date=d;
   p->next=NULL;
    if(fist==NULL)
   {

        fist=p;
        last=p;
   }
   else
   {
        last->next=p;
        last=p;
   }
   
}
return fist;

}*/

node *create_linkedlist_v2(void)
{
node *p=NULL;
node *h=NULL;
int d;
while(1)
{
p=malloc(sizeof(*p));
scanf("%d",&d);
if(d==0)
{
break;
}
else
{
p->date=d;
h=Insert(h,p);

    }
    return h;
    


}

}

void print_list(node *p)
{
while(p)
{
printf("%d",p->date);
// printf("%p\n" ,p->date);
p=p->next;

    //printf("%p\n",p);
}

}
node *Insert(node *h,node *ph)
{

node *pr=NULL;//找ps的前一个位置
node *ps=NULL;//找比p大的位置
if(ph==NULL)
{
    return h;
}   
if(h==NULL)
{
    return ph;
}
ps=h;

while(ps)
{
    if(ps->date>ph->date)
    {
       break;
    }

     pr=ps;
     ps=ps->next;


}
if(ps==NULL)
{
   pr->next=ph;
}
else
{
    if(ps==h)
    {
        ph->next=ps;
        h=ph;
    }
    else
    {
        pr->next=ph;
        ph->next=ps;
    }
}

return h;

}

int main()
{
node *h=create_linkedlist_v2();

//node *a=insert(h,p);
 print_list(h);

}

运行结果及报错内容

01链表.c: In function ‘create_linkedlist_v2’:
01链表.c:63:15: warning: implicit declaration of function ‘Insert’; did you mean ‘qsort’? [-Wimplicit-function-declaration]
h=Insert(h,p);

           qsort

01链表.c:63:14: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
h=Insert(h,p);
^
01链表.c: At top level:
01链表.c:84:7: error: conflicting types for ‘Insert’
node *Insert(node *h,node *ph)

01链表.c:63:15: note: previous implicit declaration of ‘Insert’ was here
h=Insert(h,p);
这个报错内容

我的解答思路和尝试过的方法
我想要达到的结果

insert函数要写到create函数之前,因为create函数调用了Insert函数
编译器找不到这个Insert函数具体指哪个,就开始一顿瞎猜,然后警告

我简单调试了一下,你可以对比看看,学着自己通过报错理解为什么改自己的代码。
你这主要是上面的函数用到下面的函数,需要把声明放在上面或者改变函数的顺序就好。
其他内存问题就是对象初始化时最好next赋NULL
或许你刚接触链表插入,头插法了解一下,让insert插入更简单,更容易理解。

#include <stdio.h>
#include <stdlib.h>
typedef int ElemType;
typedef struct Node
{
    ElemType date;
    struct Node *next;
}node;

node* Insert(node* h, node* ph);
void print_list(node* p);
node * create_linkedlist_v2(void)
{
    node* p = NULL;
    node* h = NULL;
    int d;
    while (1)
    {
        p = (node*)malloc(sizeof(*p));
        scanf_s("%d", &d);
        if (d == 0)
        {
            break;
        }
        else
        {
            if (p == NULL) continue;
            p->date = d;
            p->next = NULL;
            h = Insert(h, p);
        }
        return h;
    }
}

void print_list(node* p)
{
    while (p)
    {
        printf("XX = %d \n", p->date);
        // printf("%p\n" ,p->date);
        p = p->next;

        //printf("%p\n",p);
    }
}
node* Insert(node* h, node* ph)
{
    node* pr = NULL;//找ps的前一个位置
    node* ps = NULL;//找比p大的位置
    if (ph == NULL)
    {
        return h;
    }
    if (h == NULL)
    {
        return ph;
    }
    ps = h;

    while (ps)
    {
        if (ps->date > ph->date)
        {
            break;
        }

        pr = ps;
        ps = ps->next;


    }
    if (ps == NULL)
    {
        pr->next = ph;
    }
    else
    {
        if (ps == h)
        {
            ph->next = ps;
            h = ph;
        }
        else
        {
            pr->next = ph;
            ph->next = ps;
        }
    }

    return h;
}

int main()
{
    node* h = create_linkedlist_v2();

    //node *a=insert(h,p);
    print_list(h);
}