You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
482 B

#include "mysyslib.h"
ss* init(int Nums){
ss* stu = (ss*)malloc(sizeof(ss));
if(!stu) return NULL;
stu->nums = 0;
stu->student = (Student*)malloc(sizeof(Student)*Nums);
if(!stu->student) return NULL;
for(int i = 0; i < Nums; ++i){
stu->student[i].id = (char*)malloc(sizeof(char)*5);
stu->student[i].class = (char*)malloc(sizeof(char)*2);
stu->student[i].name = (char*)malloc(sizeof(char)*10);
}
return stu;
}