In my assignment I'm using structs created by my own. The questions is when freeing allocated memory should I firstly free fields of struct of it is enough to call free(ptrToStruct)?
struct Prof{
char* first_name;
char* second_name;
char** trained_classes;
int count_of_assigned_classes;
int max_classes_to_take;
int count_of_trained_classes;
int assigned_to_untrained;
};