数组静态分配:
#define Maxsize 50
typedef struct{
Elemtype data[Maxsize];
int length;
}SqList;
数组的动态分配:
#define Maxsize 50
typedef struct{
ElemType *data;
int length;
}SqList;
动态分配语句:
c:
L.data = (Elemtype*)malloc(sizeof(ElemType)*InitSize);
c++:
L.data = new ElemType[InitSize];
原文地址:https://www.cnblogs.com/1999dyq/p/11643396.html
时间: 2024-11-15 00:43:05