How to pass in different function pointers into atexit in c?

I understand that atexit() takes in a function pointer of this type void (*function)(void). What I want to do is that whenever the porgam exists it runs a function to free of all the memory. So I want atexit() to take in this function pointer instead void (*function)(struct Node). Is there a way around this,… Read More How to pass in different function pointers into atexit in c?