typedef struct stnode {
unsigned number;
char * name;
unsigned section;
struct stnode * next;
} StudentNode;
void buildStudentSections(StudentNode * sections[], StudentNode students[], size_t num_students) {
if(!num_students) return ;
StudentNode * aux=NULL;
for(int i=0;i<num_students;i++){
aux=sections[students[i].section];
(**(sections+students[i].section)).next=*(students+i);
}
}
当我尝试执行此代码时,出现此错误:
incompatible types when assigning to type ‘struct stnode *’ from type ‘StudentNode’
代码有什么问题,我已经尝试了很多东西,但没有奏效。我只想将下一个指向我正在分析的“学生”