大家好!
我想问一下load_stu_info_from_file函数中的stu_info传给list_insert函数,而list_insert函数又调用make_node函数。但是make_node函数中用到的结构体定义是
:typedef struct node{
void *data;
struct node *next;
} node;
但是load_stu_info_from_file函数中传递的实参结构体定义为:
typedef struct {
int id;
char name[32];
float mark_ch;
float mark_math;
float average;
} stu_info_t;
请教大家,这两个结构体内成员个数不同,怎么传?
是第一个结构体中的data接受所有数据吗?比如:
data = id name mark_ch mark_math average
还是第一个结构体根据传过来的参数自行再分配其他成员?