Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Cześć.
- Przypomniałem sobie właśnie, że query_module ma rowniez wypisywac liczbe studentow uczeszczajacych na przedmiot.
- Przesylam kod funkcji liczącej to:
- /**
- * Returns number of student attending to given module.
- */
- int students_to_module(char *mod_name) {
- int res = 0;
- scheme_node *tmp_sch = SCH_LIST->next;
- while (tmp_sch != NULL) {
- if (mod_search(mod_name, tmp_sch->scheme.modules) != NULL) {
- // searched module hooked to tmp_sch
- res += tmp_sch->scheme.students;
- }
- tmp_sch = tmp_sch->next;
- }
- return res;
- }
- Wystarczy w query_module wypisac wynik tej funkcji.
- Pozdrawiam
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement