编译器提示17行和21行有个警告 “取消对 NULL 指针“L”的引用。”“取消对 NULL 指针“s”的引用。”这是什么意思应该怎么改呀?
#include"stdio.h"
#include"malloc.h"
#define ElemType int
typedef struct DNode
{
ElemType data;
struct DNode* prior;
struct DNode* next;
} DLinkNode;
//建立双链表(头插法)
void CreatListF(DLinkNode*& L, ElemType a[], int n)
{
DLinkNode* s;
L = (DLinkNode*)malloc(sizeof(DLinkNode));
L->prior = L->next = NULL;
for (int i = 0; i < n; i++)
{
s = (DLinkNode*)malloc(sizeof(DLinkNode));
s->data = a[i];
s->next = L->next;
if (L->next != NULL)
L->next->prior = s;
L->next = s;
s->prior = L;
}
}