69,366
社区成员
发帖
与我相关
我的任务
分享
#include<stdio.h>
#include<malloc.h>
#define MAX_SIZE 10
typedef struct
{
int* data;
int length;
int Maxsize;
}SqeList;
void Insert(SqeList& L);
int main()
{
SqeList L;
Insert(L);
return 0;
}
void Insert(SqeList& L)
{
L.data = (int*)malloc(MAX_SIZE * sizeof(int));
L.length = 0;
//L.Maxsize = 10;
L.Maxsize = MAX_SIZE;
}
#include<stdio.h>
#include<malloc.h>
#define a 10
typedef struct
{
int* data;
int length;
int Maxsize;
}SqeList;
void Insert(SqeList& L);//函数声明在前
int main()
{
SqeList L;
Insert(L);//调用在后
return 0;
}
void Insert(SqeList& L)
{
L.data = (int*)malloc(a * sizeof(int));
L.length = 0;
L.Maxsize = 10;
}