代码
#include <string.h>
#include <stdlib.h>
#include <stdio.h>#define MAXSIZE 20
typedef int data_type;typedef struct SQLIST
{//数据元素data_type arr[MAXSIZE];int len;}sqlist;sqlist *req_mem();int main(int argc, const char *argv[])
{return 0;
}/**申请成功返回堆区内存首地址*失败返回NULL* */sqlist *req_mem()
{sqlist* list=(sqlist*)malloc(sizeof(sqlist));if(NULL==list){return NULL;}//顺序表长度清零list->len=0; //顺序表数据元素清零memset(list->arr, 0, sizeof(list->arr));return list;
}