i have a homework and i have some problems
buch->title = malloc(MAX_STR* sizeof(char));
buch->author = malloc(MAX_STR* sizeof(char));
how can i free this allocated memory?
i have a homework and i have some problems
buch->title = malloc(MAX_STR* sizeof(char));
buch->author = malloc(MAX_STR* sizeof(char));
how can i free this allocated memory?
With free
free(buch->title)
free(buch->author)
btw, later you should free buch too.
free(buch)
pd: Here is explained with 1-2D, if you need it later. How do I free memory in C?