链表练习中遇到的问题

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

写链表

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

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include<stdlib.h>

typedef struct LNode {
int data;
struct LNode* next;
}LNode, * Linklist;
Linklist CreateList1(Linklist &L, int n) {
LNode* s; LNode* headnode; int x;
headnode = (Linklist)malloc(sizeof(struct LNode));

scanf("%d", &x);
for(int t=0;t<n;t++)
{
    s = (LNode*)malloc(sizeof(LNode));
    s->data = x;
    s->next = headnode->next;
    headnode->next = s;
    scanf("%d", &x);
}
return headnode;

}
void print(Linklist o)
{
Linklist m=o->next;
while (m)
{
printf("%d", o->data);
m->next = m;
}

}
int main()
{

Linklist* p = NULL;
CreateList1(*p,5);
print(*p);
return 0;

}

运行结果及报错内容

img

我的解答思路和尝试过的方法

照着别人能运行的写 也会提示p是nullptr

我想要达到的结果

避免这样的结果

Linklist* p = NULL; 改为Linklist p = NULL;
p本身就是指针了啊
然后CreateList1(p,5);就可以了,不要加星号,因为createlist的参数是Linklist &
最后printf(p)就可以了