|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
给出关键几行:
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));这句程序就会退出?
本帖最后由 jhq999 于 2022-3-4 08:50 编辑
- int main(void)
- {
- SqList List;
- 。。。
- if(createList(&List))
复制代码
|
|