I want to write macro in c code to freeing many pointers like this :
FREE(ptr1, ptr2, ptr3, ptr4, ptrx);
For me, this is better than
Maybe you can define a function like:
void freeargs(void *ptr1, ...) { // code for freeing variable number of arguments until NULL pointer. }
and then the macro:
#define FREE(...) freeargs(__VA_ARGS__, NULL)