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);
}
}
When I try do execute this code I have this error:
incompatible types when assigning to type ‘struct stnode *’ from type ‘StudentNode’
What is the problem with the code, I already tried lots of things, but non have worked. I just want to refer the next to the "student" that i'm analyzing