Derek Parnell wrote:
On Sat, 14 Feb 2009 19:07:52 +0200, Yigal Chripun wrote:I see. Having 3 functions: malloc(), expand() and free() is indeed a very good design.Unless you need to contract the allocated memory ;-) I believe that realloc() does expansions and contractions, no?
use free() to free the part the is not needed anymore? T* arr = malloc(sizeof(T) * n); ... tail = arr[x]; free(tail);