C语言结构数组初始化的问题

2024-12-15 12:27:40
推荐回答(1个)
回答1:

你只初始了und[0]

struct undergraduate
{
int num;
char name[20];
int id;
int borrownum;
int borrowtime;
} und[20]= {{0,"",1,10,30},
{1,"",2,10,30},
{2,"",3,10,30},
{3,"",4,10,30},
... ...
};