关于malloc()与calloc()函数

给出关键几行:


typedef int Status;

typedef struct
{
        char no[11];
        char name[20];
        char xb;
        int age;
}Student;

typedef struct
{
        Student *elem;
        int length;
}SqList;

Status createList(SqList *List)
{
        List->elem=(Student *)calloc(MAX,sizeof(Student));
       
        if(List->elem==NULL)
        {
                printf("内存分配失败!\n");
                exit(1);
        }
        List->length=0;
       
        return TRUE;
}

int main(void)
{
        SqList *List;
。。。
        if(createList(List))
        {
        printf("建立成功!\n");
        }
。。。
}
}

为什么每当运行到List->elem=(Student *)calloc(MAX,sizeof(Student));这句程序就会退出?

SqList *List;并没有创建SqList结构体,List就是所谓的野指针
函数中你给List->elem赋值当然会出错

MAX是什么值,是不是MAX值太大了