C语言如何动态定义结构体数组的元素个数?

2024-11-12 18:25:08
推荐回答(1个)
回答1:

int n;
get(&n); //通过特定方法得到n
struct STUDENT *stu = (struct STUDENT*)malloc(sizeof(STUDENT) * n);