What would be the correct syntax to allocate memory to scores for each array of type sections? Can I declare a variable that points to that structure and allocate it that way? Or do I have to go through the course structure first?
I've allocated:
course* ptr = (course*)malloc(*num_courses * sizeof(course));
ptr[i].course_name = (char*)malloc(10);
ptr[i].sections = malloc(ptr[i].num_sections * sizeof(ptr[i].sections));