I have a struct which you see below:
typedef struct _List {
Person *person; // pointer for people list
DoList *do; // Kinda timer, for checking list in some intervals
} List;
Are there any need to free this struct? If so, how can i free it?
void free_mystruct(struct_List *a_ptr){
free(a_ptr->person);
free(a_ptr->do);
free(a_ptr);
}
if you used malloc to initially allocate memory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With