Original Post
What would be the faster version of the following problem and which is preferably used:
I have a recursive function which has an array(->a pointer) as an argument.
Every time the recursive function is called it calls itself a variable amount of time therefore it needs to allocate new memory for the pointer copy the content and change it for all but one call.
Is it better to allocate memory inside the recursive function or should i let the recursive process run twice?
Meaning, once to get the amount of memory needed. Then allocate that memory and then go through the process again.
-CProgrammer