free()'n args
I'm not sure if it is possible, but I want to make a function called freeAll (hopefully that is self explanitory) using a va_list, I'm not sure if this is possible, could someone help me out on this, anyway.. my reasoning is I have about 7, or 8.. variables malloc'd, and when an error occurs I have to free them all, but I think it would be easier if I could just do something like ->
freeAll(malloc_one, malloc_two, malloc_three, ...) then having to do -> free(malloc_one); free(malloc_two); free(malloc_three); I know I should've searched a little longer, and probably hunted the forums, but it's hard to phrase this in a search engine.. |
Code:
void freeAll(void **ptr, int count){ |
multi-demensional array? hmm, that could work, but I meant passing each variable.. something like:
Code:
|
All times are GMT -5. The time now is 10:55 AM. |